;INCLUDE FILE LIST:
;wdmguid.h, ntstatus.h, winerror.h, winversion.h, winnt.h, wtypes.h, winbase.h, winmapi.h,
;winnls.h, psapi.h, Winternl.h

;Copyright (c) Microsoft Corporation.  All rights reserved.
;Module Name:
;    wdmguid.h
;Abstract:
;    Defines GUIDs for function device classes and device events used in
;    Plug & Play.

;GUID_HWPROFILE_QUERY_CHANGE GUID $cb3a4001,$46f0,$11d0,$b0,$8f,0,$60,$97,$13,5,$3f
;GUID_HWPROFILE_CHANGE_CANCELLED GUID $cb3a4002,$46f0,$11d0,$b0,$8f,0,$60,$97,$13,5,$3f
;GUID_HWPROFILE_CHANGE_COMPLETE GUID $cb3a4003,$46f0,$11d0,$b0,$8f,0,$60,$97,$13,5,$3f
;GUID_DEVICE_INTERFACE_ARRIVAL GUID $cb3a4004,$46f0,$11d0,$b0,$8f,0,$60,$97,$13,5,$3f
;GUID_DEVICE_INTERFACE_REMOVAL GUID $cb3a4005,$46f0,$11d0,$b0,$8f,0,$60,$97,$13,5,$3f
;GUID_TARGET_DEVICE_QUERY_REMOVE GUID $cb3a4006,$46f0,$11d0,$b0,$8f,0,$60,$97,$13,5,$3f
;GUID_TARGET_DEVICE_REMOVE_CANCELLED GUID $cb3a4007,$46f0,$11d0,$b0,$8f,0,$60,$97,$13,5,$3f
;GUID_TARGET_DEVICE_REMOVE_COMPLETE GUID $cb3a4008,$46f0,$11d0,$b0,$8f,0,$60,$97,$13,5,$3f
;GUID_PNP_CUSTOM_NOTIFICATION GUID $ACA73F8E,$8D23,$11D1,$AC,$7D,0,0,$F8,$75,$71,$D0
;GUID_PNP_POWER_NOTIFICATION GUID $C2CF0660,$EB7A,$11D1,$BD,$7F,0,0,$F8,$75,$71,$D0

;GUID_BUS_INTERFACE_STANDARD GUID $496B8280,$6F25,$11D0,$BE,$AF,8,0,$2B,$E2,$09,$2F
;GUID_AGP_TARGET_BUS_INTERFACE_STANDARD GUID $B15CFCE8,$6D1,$4D37,$9D,$4C,$BE,$DD,$E0,$C2,$A6,$FF
;GUID_PCI_BUS_INTERFACE_STANDARD GUID $496B8281,$6F25,$11D0,$BE,$AF,8,0,$2B,$E2,9,$2F
;GUID_ARBITER_INTERFACE_STANDARD GUID $e644f185,$8c0e,$11d0,$be,$cf,8,0,$2b,$e2,9,$2f
;GUID_TRANSLATOR_INTERFACE_STANDARD GUID $6c154a92,$aacf,$11d0,$8d,$2a,0,$a0,$c9,6,$b2,$44
;GUID_ACPI_INTERFACE_STANDARD GUID $b091a08a,$ba97,$11d0,$bd,$14,0,$aa,0,$b7,$b3,$2a
;GUID_INT_ROUTE_INTERFACE_STANDARD GUID $70941bf4,$73,$11d1,$a0,$9e,0,$c0,$4f,$c3,$40,$b1
;GUID_PCMCIA_BUS_INTERFACE_STANDARD GUID $76173af0,$c504,$11d1,$94,$7f,0,$c0,$4f,$b9,$60,$ee
;GUID_ACPI_REGS_INTERFACE_STANDARD GUID $6141966,$7245,$6369,$46,$2e,$4e,$65,$6c,$73,$6f,$6e
;GUID_LEGACY_DEVICE_DETECTION_STANDARD GUID $50feb0de,$596a,$11d2,$a5,$b8,0,0,$f8,$1a,$46,$19
;GUID_PCI_DEVICE_PRESENT_INTERFACE GUID $d1b82c26,$bf49,$45ef,$b2,$16,$71,$cb,$d7,$88,$9b,$57
;GUID_MF_ENUMERATION_INTERFACE GUID $aeb895f0,$5586,$11d1,$8d,$84,0,$a0,$c9,6,$b2,$44
;GUID_ACPI_CMOS_INTERFACE_STANDARD GUID $3a8d0384,$6505,$40ca,$bc,$39,$56,$c1,$5f,$8c,$5f,$ed
;GUID_ACPI_PORT_RANGES_INTERFACE_STANDARD GUID $f14f609b,$cbbd,$4957,$a6,$74,$bc,0,$21,$3f,$1c,$97

;GUID_BUS_TYPE_INTERNAL GUID $1530ea73,$86b,$11d1,$a0,$9f,0,$c0,$4f,$c3,$40,$b1
;GUID_BUS_TYPE_PCMCIA GUID $9343630,$af9f,$11d0,$92,$E9,0,0,$f8,$1e,$1b,$30
;GUID_BUS_TYPE_PCI GUID $c8ebdfb0,$b510,$11d0,$80,$e5,0,$a0,$c9,$25,$42,$e3
;GUID_BUS_TYPE_ISAPNP GUID $e676f854,$d87d,$11d0,$92,$b2,0,$a0,$c9,5,$5f,$c5
;GUID_BUS_TYPE_EISA GUID $ddc35509,$f3fc,$11d0,$a5,$37,0,$00,$f8,$75,$3e,$d1
;GUID_BUS_TYPE_MCA GUID $1c75997a,$dc33,$11d0,$92,$b2,0,$a0,$c9,5,$5f,$c5
;GUID_BUS_TYPE_LPTENUM GUID $c4ca1000,$2ddc,$11d5,$a1,$7a,0,$c0,$4f,$60,$52,$4d
;GUID_BUS_TYPE_USBPRINT GUID $441ee000,$4342,$11d5,$a1,$84,0,$c0,$4f,$60,$52,$4d
;GUID_BUS_TYPE_DOT4PRT GUID $441ee001,$4342,$11d5,$a1,$84,0,$c0,$4f,$60,$52,$4d
;GUID_BUS_TYPE_SERENUM GUID $77114a87,$8944,$11d1,$bd,$90,0,$a0,$c9,6,$be,$2d
;GUID_BUS_TYPE_USB GUID $9d7debbc,$c85d,$11d1,$9e,$b4,0,$60,8,$c3,$a1,$9a
;GUID_BUS_TYPE_1394 GUID $f74e73eb,$9ac5,$45eb,$be,$4d,$77,$2c,$c7,$1d,$df,$b3
;GUID_BUS_TYPE_HID GUID $eeaf37d0,$1963,$47c4,$aa,$48,$72,$47,$6d,$b7,$cf,$49
;GUID_BUS_TYPE_AVC GUID $c06ff265,$ae09,$48f0,$81,$2c,$16,$75,$3d,$7c,$ba,$83
;GUID_BUS_TYPE_IRDA GUID $7ae17dc1,$c944,$44d6,$88,$1f,$4c,$2e,$61,5,$3b,$c1
;GUID_BUS_TYPE_SD GUID $e700cc04,$4036,$4e89,$95,$79,$89,$eb,$f4,$5f,0,$cd

;GUID_POWER_DEVICE_ENABLE GUID $827c0a6f,$feb0,$11d0,$bd,$26,0,$aa,0,$b7,$b3,$2a
;GUID_POWER_DEVICE_TIMEOUTS GUID $a45da735,$feb0,$11d0,$bd,$26,0,$aa,0,$b7,$b3,$2a
;GUID_POWER_DEVICE_WAKE_ENABLE GUID $a9546a82,$feb0,$11d0,$bd,$26,0,$aa,0,$b7,$b3,$2a


;Copyright (c) Microsoft Corporation.  All rights reserved.
;Module Name: ntstatus.h
;Abstract:    Constant definitions for the NTSTATUS values.
;Author:      Portable Systems Group 30-Mar-1989

struct RECT
       left dd ?
       top dd ?
       right dd ?
       bottom dd ?
ends

struct RECTL
       left dd ?
       top dd ?
       right dd ?
       bottom dd ?
ends

struct POINT
       x dd ?
       y dd ?
ends

struct POINTL
       x dd ?
       y dd ?
ends

struct POINTS
       x dd ?
       y dd ?
ends

;guiddef.h
struct GUID
       Data1 dd ?
       Data2 dw ?
       Data3 dw ?
       Data4 db 8 dup(?)
ends

;wintypes.h
struct SIZEL
       cx dd ?
       cy dd ?
ends

struct VSFIXEDFILEINFO
       dwSignature dd ?
       dwStrucVersion dd ?
       dwFileVersionMS dd ?
       dwFileVersionLS dd ?
       dwProductVersionMS dd ?
       dwProductVersionLS dd ?
       dwFileFlagsMask dd ?
       dwFileFlags dd ?
       dwFileOS dd ?
       dwFileType dd ?
       dwFileSubtype dd ?
       dwFileDateMS dd ?
       dwFileDateLS dd ?
ends

struct REMHGLOBAL
       fNullHGlobal dd ?
       cbData dd ?
       data db 4 dup(?)
ends

struct SIZE
       cx dd ?
       cy dd ?
ends

struct FLOAT128
       LowPart dq ?
       HighPart dq ?
ends


struct LARGEINTEGER
       union
	   LowPart dd ?
	   HighPart dd ?
	   QuadPart dq ?
       ends
ends

struct ULARGEINTEGER
       union
	   LowPart dd ?
	   HighPart dd ?
       ends
       QuadPart dq ?
ends

struct LUID
       LowPart dd ?
       HighPart dd ?
ends

struct SINGLELISTENTRY
       Next dq ?
ends

struct LISTENTRY32
       Flink dd ?
       Blink dd ?
ends

struct LISTENTRY64
       Flink dq ?
       Blink dq ?
ends

struct OBJECTID
       Lineage GUID
       Uniquifier dd ?
ends

struct ACCEL
       fVirt dw ?
       key dw ?
       cmd dd ?
ends

struct PAINTSTRUCT
       hdc dq ?
       fErase dd ?
       rcPaint RECT
       fRestore dd ?
       fIncUpdate dd ?
       rgbReserved db 36 dup(?)
ends

struct CREATESTRUCTA
       lpCreateParams dq ?
       hInstance dq ?
       hMenu dq ?
       hwndParent dq ?
       cy dd ?
       cx dd ?
       y dd ?
       x dd ?
       style dd ?,?
       lpszName dq ?
       lpszClass dq ?
       dwExStyle dd ?,?
ends

struct CREATESTRUCTW
       lpCreateParams dq ?
       hInstance dq ?
       hMenu dq ?
       hwndParent dq ?
       cy dd ?
       cx dd ?
       y dd ?
       x dd ?
       style dd ?,?
       lpszName dq ?
       lpszClass dq ?
       dwExStyle dd ?,?
ends

struct WINDOWPLACEMENT
       length dd ?
       flags dd ?
       showCmd dd ?
       ptMinPosition POINT
       ptMaxPosition POINT
       rcNormalPosition RECT
ends

struct NMHDR
       hwndFrom dq ?
       idFrom dq ?
       code dd ?,?
ends

struct STYLESTRUCT
       styleOld dd ?
       styleNew dd ?
ends

FACILITY_VIDEO = $1B
FACILITY_USB_ERROR_CODE = $10
FACILITY_TRANSACTION = $19
FACILITY_TERMINAL_SERVER = $A
FACILITY_SXS_ERROR_CODE = $15
FACILITY_NTSSPI = $9
FACILITY_RPC_STUBS = $3
FACILITY_RPC_RUNTIME = $2
FACILITY_NTWIN32 = $7
FACILITY_NDIS_ERROR_CODE = $23
FACILTIY_MUI_ERROR_CODE = $B
FACILITY_MONITOR = $1D
FACILITY_MAXIMUM_VALUE = $37
FACILITY_IPSEC = $36
FACILITY_IO_ERROR_CODE = $4
FACILITY_HYPERVISOR = $35
FACILITY_HID_ERROR_CODE = $11
FACILITY_GRAPHICS_KERNEL = $1E
FACILITY_FWP_ERROR_CODE = $22
FACILITY_FVE_ERROR_CODE = $21
FACILITY_FIREWIRE_ERROR_CODE = $12
FACILITY_FILTER_MANAGER = $1C
FACILITY_DRIVER_FRAMEWORK = $20
FACILITY_DEBUGGER = $1
FACILITY_COMMONLOG = $1A
FACILITY_CLUSTER_ERROR_CODE = $13
FACILITY_ACPI_ERROR_CODE = $14

STATUS_SEVERITY_WARNING = 2
STATUS_SEVERITY_SUCCESS = 0
STATUS_SEVERITY_INFORMATIONAL = 1
STATUS_SEVERITY_ERROR = 3
STATUS_WAIT_0 = 0
STATUS_WAIT_1 = 1
STATUS_WAIT_2 = 2
STATUS_WAIT_3 = 3
STATUS_WAIT_63 = $3F
STATUS_ABANDONED = $80
STATUS_ABANDONED_WAIT_0 = $80
STATUS_ABANDONED_WAIT_63 = $BF
STATUS_USER_APC = $C0
STATUS_KERNEL_APC = $100
STATUS_ALERTED = $101
STATUS_TIMEOUT = $102
STATUS_PENDING = $103
STATUS_REPARSE = $104
STATUS_MORE_ENTRIES = $105
STATUS_NOT_ALL_ASSIGNED = $106
STATUS_SOME_NOT_MAPPED = $107
STATUS_OPLOCK_BREAK_IN_PROGRESS = $108
STATUS_VOLUME_MOUNTED = $109
STATUS_RXACT_COMMITTED = $10A
STATUS_NOTIFY_CLEANUP = $10B
STATUS_NOTIFY_ENUM_DIR = $10C
STATUS_NO_QUOTAS_FOR_ACCOUNT = $10D
STATUS_PRIMARY_TRANSPORT_CONNECT_FAILED  = $10E
STATUS_PAGE_FAULT_TRANSITION = $110
STATUS_PAGE_FAULT_DEMAND_ZERO = $111
STATUS_PAGE_FAULT_COPY_ON_WRITE = $112
STATUS_PAGE_FAULT_GUARD_PAGE = $113
STATUS_PAGE_FAULT_PAGING_FILE = $114
STATUS_CACHE_PAGE_LOCKED  = $115
STATUS_CRASH_DUMP = $116
STATUS_BUFFER_ALL_ZEROS = $117
STATUS_REPARSE_OBJECT = $118
STATUS_RESOURCE_REQUIREMENTS_CHANGED  = $119
STATUS_TRANSLATION_COMPLETE = $120
STATUS_DS_MEMBERSHIP_EVALUATED_LOCALLY	= $121
STATUS_NOTHING_TO_TERMINATE = $122
STATUS_PROCESS_NOT_IN_JOB = $123
STATUS_PROCESS_IN_JOB = $124
STATUS_VOLSNAP_HIBERNATE_READY = $125
STATUS_FSFILTER_OP_COMPLETED_SUCCESSFULLY  = $126
STATUS_OBJECT_NAME_EXISTS = $40000000
STATUS_THREAD_WAS_SUSPENDED = $40000001
STATUS_WORKING_SET_LIMIT_RANGE = $40000002
STATUS_IMAGE_NOT_AT_BASE = $40000003
STATUS_RXACT_STATE_CREATED = $40000004
STATUS_SEGMENT_NOTIFICATION = $40000005
STATUS_LOCAL_USER_SESSION_KEY = $40000006
STATUS_BAD_CURRENT_DIRECTORY = $40000007
STATUS_SERIAL_MORE_WRITES = $40000008
STATUS_REGISTRY_RECOVERED = $40000009
STATUS_FT_READ_RECOVERY_FROM_BACKUP = $4000000A
STATUS_FT_WRITE_RECOVERY = $4000000B
STATUS_SERIAL_COUNTER_TIMEOUT = $4000000C
STATUS_NULL_LM_PASSWORD = $4000000D
STATUS_IMAGE_MACHINE_TYPE_MISMATCH = $4000000E
STATUS_RECEIVE_PARTIAL = $4000000F
STATUS_RECEIVE_EXPEDITED = $40000010
STATUS_RECEIVE_PARTIAL_EXPEDITED = $40000011
STATUS_EVENT_DONE = $40000012
STATUS_EVENT_PENDING = $40000013
STATUS_CHECKING_FILE_SYSTEM  = $40000014
STATUS_FATAL_APP_EXIT = $40000015
STATUS_PREDEFINED_HANDLE = $40000016
STATUS_WAS_UNLOCKED = $40000017
STATUS_SERVICE_NOTIFICATION = $40000018
STATUS_WAS_LOCKED = $40000019
STATUS_LOG_HARD_ERROR = $4000001A
STATUS_ALREADY_WIN32 = $4000001B
STATUS_WX86_UNSIMULATE	= $4000001C
STATUS_WX86_CONTINUE = $4000001D
STATUS_WX86_SINGLE_STEP = $4000001E
STATUS_WX86_BREAKPOINT = $4000001F
STATUS_WX86_EXCEPTION_CONTINUE = $40000020
STATUS_WX86_EXCEPTION_LASTCHANCE = $40000021
STATUS_WX86_EXCEPTION_CHAIN = $40000022
STATUS_IMAGE_MACHINE_TYPE_MISMATCH_EXE = $40000023
STATUS_NO_YIELD_PERFORMED = $40000024
STATUS_TIMER_RESUME_IGNORED = $40000025
STATUS_ARBITRATION_UNHANDLED = $40000026
STATUS_CARDBUS_NOT_SUPPORTED = $40000027
STATUS_WX86_CREATEWX86TIB = $40000028
STATUS_MP_PROCESSOR_MISMATCH = $40000029
STATUS_HIBERNATED = $4000002A
STATUS_RESUME_HIBERNATION = $4000002B
STATUS_FIRMWARE_UPDATED = $4000002C
STATUS_DRIVERS_LEAKING_LOCKED_PAGES = $4000002D

DBG_EXCEPTION_HANDLED = $00010001
DBG_CONTINUE = $00010002
DBG_REPLY_LATER = $40010001
DBG_UNABLE_TO_PROVIDE_HANDLE = $40010002
DBG_TERMINATE_THREAD = $40010003
DBG_TERMINATE_PROCESS = $40010004
DBG_CONTROL_C = $40010005
DBG_PRINTEXCEPTION_C = $40010006
DBG_RIPEXCEPTION = $40010007
DBG_CONTROL_BREAK = $40010008
DBG_COMMAND_EXCEPTION = $40010009

STATUS_GUARD_PAGE_VIOLATION = $80000001
STATUS_DATATYPE_MISALIGNMENT = $80000002
STATUS_BREAKPOINT = $80000003
STATUS_SINGLE_STEP = $80000004
STATUS_BUFFER_OVERFLOW = $80000005
STATUS_NO_MORE_FILES = $80000006
STATUS_WAKE_SYSTEM_DEBUGGER = $80000007
STATUS_HANDLES_CLOSED = $8000000A
STATUS_NO_INHERITANCE = $8000000B
STATUS_GUID_SUBSTITUTION_MADE = $8000000C
STATUS_PARTIAL_COPY = $8000000D
STATUS_DEVICE_PAPER_EMPTY = $8000000E
STATUS_DEVICE_POWERED_OFF = $8000000F
STATUS_DEVICE_OFF_LINE = $80000010
STATUS_DEVICE_BUSY = $80000011
STATUS_NO_MORE_EAS = $80000012
STATUS_INVALID_EA_NAME = $80000013
STATUS_EA_LIST_INCONSISTENT = $80000014
STATUS_INVALID_EA_FLAG = $80000015
STATUS_VERIFY_REQUIRED = $80000016
STATUS_EXTRANEOUS_INFORMATION = $80000017
STATUS_RXACT_COMMIT_NECESSARY = $80000018
STATUS_NO_MORE_ENTRIES = $8000001A
STATUS_FILEMARK_DETECTED = $8000001B
STATUS_MEDIA_CHANGED = $8000001C
STATUS_BUS_RESET = $8000001D
STATUS_END_OF_MEDIA  = $8000001E
STATUS_BEGINNING_OF_MEDIA = $8000001F
STATUS_MEDIA_CHECK = $80000020
STATUS_SETMARK_DETECTED = $80000021
STATUS_NO_DATA_DETECTED = $80000022
STATUS_REDIRECTOR_HAS_OPEN_HANDLES = $80000023
STATUS_SERVER_HAS_OPEN_HANDLES = $80000024
STATUS_ALREADY_DISCONNECTED = $80000025
STATUS_LONGJUMP = $80000026
STATUS_CLEANER_CARTRIDGE_INSTALLED = $80000027
STATUS_PLUGPLAY_QUERY_VETOED = $80000028
STATUS_UNWIND_CONSOLIDATE = $80000029
STATUS_REGISTRY_HIVE_RECOVERED = $8000002A
STATUS_DLL_MIGHT_BE_INSECURE = $8000002B
STATUS_DLL_MIGHT_BE_INCOMPATIBLE = $8000002C

DBG_EXCEPTION_NOT_HANDLED = $80010001

STATUS_CLUSTER_NODE_ALREADY_UP = $80130001
STATUS_CLUSTER_NODE_ALREADY_DOWN = $80130002
STATUS_CLUSTER_NETWORK_ALREADY_ONLINE = $80130003
STATUS_CLUSTER_NETWORK_ALREADY_OFFLINE = $80130004
STATUS_CLUSTER_NODE_ALREADY_MEMBER = $80130005
STATUS_UNSUCCESSFUL = $C0000001
STATUS_NOT_IMPLEMENTED = $C0000002
STATUS_INVALID_INFO_CLASS = $C0000003
STATUS_INFO_LENGTH_MISMATCH = $C0000004
STATUS_ACCESS_VIOLATION = $C0000005
STATUS_IN_PAGE_ERROR = $C0000006
STATUS_PAGEFILE_QUOTA = $C0000007
STATUS_INVALID_HANDLE = $C0000008
STATUS_BAD_INITIAL_STACK = $C0000009
STATUS_BAD_INITIAL_PC = $C000000A
STATUS_INVALID_CID = $C000000B
STATUS_TIMER_NOT_CANCELED = $C000000C
STATUS_INVALID_PARAMETER  = $C000000D
STATUS_NO_SUCH_DEVICE = $C000000E
STATUS_NO_SUCH_FILE = $C000000F
STATUS_INVALID_DEVICE_REQUEST = $C0000010
STATUS_END_OF_FILE = $C0000011
STATUS_WRONG_VOLUME = $C0000012
STATUS_NO_MEDIA_IN_DEVICE = $C0000013
STATUS_UNRECOGNIZED_MEDIA = $C0000014
STATUS_NONEXISTENT_SECTOR = $C0000015
STATUS_MORE_PROCESSING_REQUIRED = $C0000016
STATUS_NO_MEMORY = $C0000017
STATUS_CONFLICTING_ADDRESSES = $C0000018
STATUS_NOT_MAPPED_VIEW = $C0000019
STATUS_UNABLE_TO_FREE_VM = $C000001A
STATUS_UNABLE_TO_DELETE_SECTION = $C000001B
STATUS_INVALID_SYSTEM_SERVICE = $C000001C
STATUS_ILLEGAL_INSTRUCTION = $C000001D
STATUS_INVALID_LOCK_SEQUENCE  = $C000001E
STATUS_INVALID_VIEW_SIZE = $C000001F
STATUS_INVALID_FILE_FOR_SECTION = $C0000020
STATUS_ALREADY_COMMITTED = $C0000021
STATUS_ACCESS_DENIED = $C0000022
STATUS_BUFFER_TOO_SMALL = $C0000023
STATUS_OBJECT_TYPE_MISMATCH = $C0000024
STATUS_NONCONTINUABLE_EXCEPTION = $C0000025
STATUS_INVALID_DISPOSITION = $C0000026
STATUS_UNWIND = $C0000027
STATUS_BAD_STACK = $C0000028
STATUS_INVALID_UNWIND_TARGET = $C0000029
STATUS_NOT_LOCKED = $C000002A
STATUS_PARITY_ERROR = $C000002B
STATUS_UNABLE_TO_DECOMMIT_VM = $C000002C
STATUS_NOT_COMMITTED = $C000002D
STATUS_INVALID_PORT_ATTRIBUTES = $C000002E
STATUS_PORT_MESSAGE_TOO_LONG = $C000002F
STATUS_INVALID_PARAMETER_MIX = $C0000030
STATUS_INVALID_QUOTA_LOWER = $C0000031
STATUS_DISK_CORRUPT_ERROR = $C0000032
STATUS_OBJECT_NAME_INVALID = $C0000033
STATUS_OBJECT_NAME_NOT_FOUND = $C0000034
STATUS_OBJECT_NAME_COLLISION = $C0000035
STATUS_PORT_DISCONNECTED = $C0000037
STATUS_DEVICE_ALREADY_ATTACHED = $C0000038
STATUS_OBJECT_PATH_INVALID = $C0000039
STATUS_OBJECT_PATH_NOT_FOUND = $C000003A
STATUS_OBJECT_PATH_SYNTAX_BAD = $C000003B
STATUS_DATA_OVERRUN = $C000003C
STATUS_DATA_LATE_ERROR = $C000003D
STATUS_DATA_ERROR = $C000003E
STATUS_CRC_ERROR = $C000003F
STATUS_SECTION_TOO_BIG = $C0000040
STATUS_PORT_CONNECTION_REFUSED = $C0000041
STATUS_INVALID_PORT_HANDLE = $C0000042
STATUS_SHARING_VIOLATION = $C0000043
STATUS_QUOTA_EXCEEDED = $C0000044
STATUS_INVALID_PAGE_PROTECTION = $C0000045
STATUS_MUTANT_NOT_OWNED = $C0000046
STATUS_SEMAPHORE_LIMIT_EXCEEDED = $C0000047
STATUS_PORT_ALREADY_SET = $C0000048
STATUS_SECTION_NOT_IMAGE = $C0000049
STATUS_SUSPEND_COUNT_EXCEEDED = $C000004A
STATUS_THREAD_IS_TERMINATING = $C000004B
STATUS_BAD_WORKING_SET_LIMIT = $C000004C
STATUS_INCOMPATIBLE_FILE_MAP = $C000004D
STATUS_SECTION_PROTECTION = $C000004E
STATUS_EAS_NOT_SUPPORTED = $C000004F
STATUS_EA_TOO_LARGE = $C0000050
STATUS_NONEXISTENT_EA_ENTRY = $C0000051
STATUS_NO_EAS_ON_FILE = $C0000052
STATUS_EA_CORRUPT_ERROR = $C0000053
STATUS_FILE_LOCK_CONFLICT = $C0000054
STATUS_LOCK_NOT_GRANTED = $C0000055
STATUS_DELETE_PENDING = $C0000056
STATUS_CTL_FILE_NOT_SUPPORTED = $C0000057
STATUS_UNKNOWN_REVISION = $C0000058
STATUS_REVISION_MISMATCH = $C0000059
STATUS_INVALID_OWNER = $C000005A
STATUS_INVALID_PRIMARY_GROUP = $C000005B
STATUS_NO_IMPERSONATION_TOKEN = $C000005C
STATUS_CANT_DISABLE_MANDATORY = $C000005D
STATUS_NO_LOGON_SERVERS = $C000005E
STATUS_NO_SUCH_LOGON_SESSION = $C000005F
STATUS_NO_SUCH_PRIVILEGE = $C0000060
STATUS_PRIVILEGE_NOT_HELD = $C0000061
STATUS_INVALID_ACCOUNT_NAME = $C0000062
STATUS_USER_EXISTS = $C0000063
STATUS_NO_SUCH_USER = $C0000064
STATUS_GROUP_EXISTS = $C0000065
STATUS_NO_SUCH_GROUP = $C0000066
STATUS_MEMBER_IN_GROUP = $C0000067
STATUS_MEMBER_NOT_IN_GROUP = $C0000068
STATUS_LAST_ADMIN = $C0000069
STATUS_WRONG_PASSWORD = $C000006A
STATUS_ILL_FORMED_PASSWORD = $C000006B
STATUS_PASSWORD_RESTRICTION = $C000006C
STATUS_LOGON_FAILURE = $C000006D
STATUS_ACCOUNT_RESTRICTION = $C000006E
STATUS_INVALID_LOGON_HOURS = $C000006F
STATUS_INVALID_WORKSTATION = $C0000070
STATUS_PASSWORD_EXPIRED = $C0000071
STATUS_ACCOUNT_DISABLED = $C0000072
STATUS_NONE_MAPPED = $C0000073
STATUS_TOO_MANY_LUIDS_REQUESTED = $C0000074
STATUS_LUIDS_EXHAUSTED = $C0000075
STATUS_INVALID_SUB_AUTHORITY = $C0000076
STATUS_INVALID_ACL = $C0000077
STATUS_INVALID_SID = $C0000078
STATUS_INVALID_SECURITY_DESCR = $C0000079
STATUS_PROCEDURE_NOT_FOUND = $C000007A
STATUS_INVALID_IMAGE_FORMAT = $C000007B
STATUS_NO_TOKEN = $C000007C
STATUS_BAD_INHERITANCE_ACL = $C000007D
STATUS_RANGE_NOT_LOCKED = $C000007E
STATUS_DISK_FULL = $C000007F
STATUS_SERVER_DISABLED = $C0000080
STATUS_SERVER_NOT_DISABLED = $C0000081
STATUS_TOO_MANY_GUIDS_REQUESTED = $C0000082
STATUS_GUIDS_EXHAUSTED = $C0000083
STATUS_INVALID_ID_AUTHORITY = $C0000084
STATUS_AGENTS_EXHAUSTED = $C0000085
STATUS_INVALID_VOLUME_LABEL = $C0000086
STATUS_SECTION_NOT_EXTENDED = $C0000087
STATUS_NOT_MAPPED_DATA = $C0000088
STATUS_RESOURCE_DATA_NOT_FOUND = $C0000089
STATUS_RESOURCE_TYPE_NOT_FOUND = $C000008A
STATUS_RESOURCE_NAME_NOT_FOUND = $C000008B
STATUS_ARRAY_BOUNDS_EXCEEDED = $C000008C
STATUS_FLOAT_DENORMAL_OPERAND = $C000008D
STATUS_FLOAT_DIVIDE_BY_ZERO = $C000008E
STATUS_FLOAT_INEXACT_RESULT = $C000008F
STATUS_FLOAT_INVALID_OPERATION = $C0000090
STATUS_FLOAT_OVERFLOW = $C0000091
STATUS_FLOAT_STACK_CHECK = $C0000092
STATUS_FLOAT_UNDERFLOW = $C0000093
STATUS_INTEGER_DIVIDE_BY_ZERO = $C0000094
STATUS_INTEGER_OVERFLOW = $C0000095
STATUS_PRIVILEGED_INSTRUCTION = $C0000096
STATUS_TOO_MANY_PAGING_FILES = $C0000097
STATUS_FILE_INVALID = $C0000098
STATUS_ALLOTTED_SPACE_EXCEEDED = $C0000099
STATUS_INSUFFICIENT_RESOURCES = $C000009A
STATUS_DFS_EXIT_PATH_FOUND = $C000009B
STATUS_DEVICE_DATA_ERROR = $C000009C
STATUS_DEVICE_NOT_CONNECTED = $C000009D
STATUS_DEVICE_POWER_FAILURE = $C000009E
STATUS_FREE_VM_NOT_AT_BASE = $C000009F
STATUS_MEMORY_NOT_ALLOCATED = $C00000A0
STATUS_WORKING_SET_QUOTA = $C00000A1
STATUS_MEDIA_WRITE_PROTECTED = $C00000A2
STATUS_DEVICE_NOT_READY = $C00000A3
STATUS_INVALID_GROUP_ATTRIBUTES = $C00000A4
STATUS_BAD_IMPERSONATION_LEVEL = $C00000A5
STATUS_CANT_OPEN_ANONYMOUS = $C00000A6
STATUS_BAD_VALIDATION_CLASS = $C00000A7
STATUS_BAD_TOKEN_TYPE = $C00000A8
STATUS_BAD_MASTER_BOOT_RECORD = $C00000A9
STATUS_INSTRUCTION_MISALIGNMENT = $C00000AA
STATUS_INSTANCE_NOT_AVAILABLE = $C00000AB
STATUS_PIPE_NOT_AVAILABLE = $C00000AC
STATUS_INVALID_PIPE_STATE = $C00000AD
STATUS_PIPE_BUSY = $C00000AE
STATUS_ILLEGAL_FUNCTION = $C00000AF
STATUS_PIPE_DISCONNECTED = $C00000B0
STATUS_PIPE_CLOSING = $C00000B1
STATUS_PIPE_CONNECTED = $C00000B2
STATUS_PIPE_LISTENING = $C00000B3
STATUS_INVALID_READ_MODE = $C00000B4
STATUS_IO_TIMEOUT = $C00000B5
STATUS_FILE_FORCED_CLOSED = $C00000B6
STATUS_PROFILING_NOT_STARTED = $C00000B7
STATUS_PROFILING_NOT_STOPPED = $C00000B8
STATUS_COULD_NOT_INTERPRET = $C00000B9
STATUS_FILE_IS_A_DIRECTORY = $C00000BA
STATUS_NOT_SUPPORTED = $C00000BB
STATUS_REMOTE_NOT_LISTENING = $C00000BC
STATUS_DUPLICATE_NAME = $C00000BD
STATUS_BAD_NETWORK_PATH = $C00000BE
STATUS_NETWORK_BUSY = $C00000BF
STATUS_DEVICE_DOES_NOT_EXIST = $C00000C0
STATUS_TOO_MANY_COMMANDS = $C00000C1
STATUS_ADAPTER_HARDWARE_ERROR = $C00000C2
STATUS_INVALID_NETWORK_RESPONSE = $C00000C3
STATUS_UNEXPECTED_NETWORK_ERROR = $C00000C4
STATUS_BAD_REMOTE_ADAPTER = $C00000C5
STATUS_PRINT_QUEUE_FULL = $C00000C6
STATUS_NO_SPOOL_SPACE = $C00000C7
STATUS_PRINT_CANCELLED = $C00000C8
STATUS_NETWORK_NAME_DELETED = $C00000C9
STATUS_NETWORK_ACCESS_DENIED = $C00000CA
STATUS_BAD_DEVICE_TYPE = $C00000CB
STATUS_BAD_NETWORK_NAME = $C00000CC
STATUS_TOO_MANY_NAMES = $C00000CD
STATUS_TOO_MANY_SESSIONS = $C00000CE
STATUS_SHARING_PAUSED = $C00000CF
STATUS_REQUEST_NOT_ACCEPTED = $C00000D0
STATUS_REDIRECTOR_PAUSED = $C00000D1
STATUS_NET_WRITE_FAULT = $C00000D2
STATUS_PROFILING_AT_LIMIT = $C00000D3
STATUS_NOT_SAME_DEVICE = $C00000D4
STATUS_FILE_RENAMED = $C00000D5
STATUS_VIRTUAL_CIRCUIT_CLOSED = $C00000D6
STATUS_NO_SECURITY_ON_OBJECT = $C00000D7
STATUS_CANT_WAIT = $C00000D8
STATUS_PIPE_EMPTY = $C00000D9
STATUS_CANT_ACCESS_DOMAIN_INFO = $C00000DA
STATUS_CANT_TERMINATE_SELF = $C00000DB
STATUS_INVALID_SERVER_STATE = $C00000DC
STATUS_INVALID_DOMAIN_STATE = $C00000DD
STATUS_INVALID_DOMAIN_ROLE = $C00000DE
STATUS_NO_SUCH_DOMAIN = $C00000DF
STATUS_DOMAIN_EXISTS = $C00000E0
STATUS_DOMAIN_LIMIT_EXCEEDED = $C00000E1
STATUS_OPLOCK_NOT_GRANTED = $C00000E2
STATUS_INVALID_OPLOCK_PROTOCOL = $C00000E3
STATUS_INTERNAL_DB_CORRUPTION = $C00000E4
STATUS_INTERNAL_ERROR = $C00000E5
STATUS_GENERIC_NOT_MAPPED = $C00000E6
STATUS_BAD_DESCRIPTOR_FORMAT = $C00000E7
STATUS_INVALID_USER_BUFFER = $C00000E8
STATUS_UNEXPECTED_IO_ERROR = $C00000E9
STATUS_UNEXPECTED_MM_CREATE_ERR = $C00000EA
STATUS_UNEXPECTED_MM_MAP_ERROR = $C00000EB
STATUS_UNEXPECTED_MM_EXTEND_ERR = $C00000EC
STATUS_NOT_LOGON_PROCESS = $C00000ED
STATUS_LOGON_SESSION_EXISTS = $C00000EE
STATUS_INVALID_PARAMETER_1 = $C00000EF
STATUS_INVALID_PARAMETER_2 = $C00000F0
STATUS_INVALID_PARAMETER_3 = $C00000F1
STATUS_INVALID_PARAMETER_4 = $C00000F2
STATUS_INVALID_PARAMETER_5 = $C00000F3
STATUS_INVALID_PARAMETER_6 = $C00000F4
STATUS_INVALID_PARAMETER_7 = $C00000F5
STATUS_INVALID_PARAMETER_8 = $C00000F6
STATUS_INVALID_PARAMETER_9 = $C00000F7
STATUS_INVALID_PARAMETER_10 = $C00000F8
STATUS_INVALID_PARAMETER_11 = $C00000F9
STATUS_INVALID_PARAMETER_12 = $C00000FA
STATUS_REDIRECTOR_NOT_STARTED = $C00000FB
STATUS_REDIRECTOR_STARTED = $C00000FC
STATUS_STACK_OVERFLOW = $C00000FD
STATUS_NO_SUCH_PACKAGE = $C00000FE
STATUS_BAD_FUNCTION_TABLE = $C00000FF
STATUS_VARIABLE_NOT_FOUND = $C0000100
STATUS_DIRECTORY_NOT_EMPTY = $C0000101
STATUS_FILE_CORRUPT_ERROR = $C0000102
STATUS_NOT_A_DIRECTORY = $C0000103
STATUS_BAD_LOGON_SESSION_STATE = $C0000104
STATUS_LOGON_SESSION_COLLISION = $C0000105
STATUS_NAME_TOO_LONG = $C0000106
STATUS_FILES_OPEN = $C0000107
STATUS_CONNECTION_IN_USE = $C0000108
STATUS_MESSAGE_NOT_FOUND = $C0000109
STATUS_PROCESS_IS_TERMINATING = $C000010A
STATUS_INVALID_LOGON_TYPE = $C000010B
STATUS_NO_GUID_TRANSLATION = $C000010C
STATUS_CANNOT_IMPERSONATE = $C000010D
STATUS_IMAGE_ALREADY_LOADED = $C000010E
STATUS_ABIOS_NOT_PRESENT = $C000010F
STATUS_ABIOS_LID_NOT_EXIST = $C0000110
STATUS_ABIOS_LID_ALREADY_OWNED = $C0000111
STATUS_ABIOS_NOT_LID_OWNER = $C0000112
STATUS_ABIOS_INVALID_COMMAND = $C0000113
STATUS_ABIOS_INVALID_LID = $C0000114
STATUS_ABIOS_SELECTOR_NOT_AVAILABLE = $C0000115
STATUS_ABIOS_INVALID_SELECTOR = $C0000116
STATUS_NO_LDT = $C0000117
STATUS_INVALID_LDT_SIZE = $C0000118
STATUS_INVALID_LDT_OFFSET = $C0000119
STATUS_INVALID_LDT_DESCRIPTOR = $C000011A
STATUS_INVALID_IMAGE_NE_FORMAT = $C000011B
STATUS_RXACT_INVALID_STATE = $C000011C
STATUS_RXACT_COMMIT_FAILURE = $C000011D
STATUS_MAPPED_FILE_SIZE_ZERO = $C000011E
STATUS_TOO_MANY_OPENED_FILES = $C000011F
STATUS_CANCELLED = $C0000120
STATUS_CANNOT_DELETE = $C0000121
STATUS_INVALID_COMPUTER_NAME = $C0000122
STATUS_FILE_DELETED = $C0000123
STATUS_SPECIAL_ACCOUNT = $C0000124
STATUS_SPECIAL_GROUP = $C0000125
STATUS_SPECIAL_USER = $C0000126
STATUS_MEMBERS_PRIMARY_GROUP = $C0000127
STATUS_FILE_CLOSED = $C0000128
STATUS_TOO_MANY_THREADS = $C0000129
STATUS_THREAD_NOT_IN_PROCESS = $C000012A
STATUS_TOKEN_ALREADY_IN_USE  = $C000012B
STATUS_PAGEFILE_QUOTA_EXCEEDED = $C000012C
STATUS_COMMITMENT_LIMIT = $C000012D
STATUS_INVALID_IMAGE_LE_FORMAT = $C000012E
STATUS_INVALID_IMAGE_NOT_MZ = $C000012F
STATUS_INVALID_IMAGE_PROTECT = $C0000130
STATUS_INVALID_IMAGE_WIN_16 = $C0000131
STATUS_LOGON_SERVER_CONFLICT = $C0000132
STATUS_TIME_DIFFERENCE_AT_DC = $C0000133
STATUS_SYNCHRONIZATION_REQUIRED = $C0000134
STATUS_DLL_NOT_FOUND = $C0000135
STATUS_OPEN_FAILED = $C0000136
STATUS_IO_PRIVILEGE_FAILED = $C0000137
STATUS_ORDINAL_NOT_FOUND = $C0000138
STATUS_ENTRYPOINT_NOT_FOUND = $C0000139
STATUS_CONTROL_C_EXIT = $C000013A
STATUS_LOCAL_DISCONNECT = $C000013B
STATUS_REMOTE_DISCONNECT = $C000013C
STATUS_REMOTE_RESOURCES = $C000013D
STATUS_LINK_FAILED = $C000013E
STATUS_LINK_TIMEOUT = $C000013F
STATUS_INVALID_CONNECTION = $C0000140
STATUS_INVALID_ADDRESS = $C0000141
STATUS_DLL_INIT_FAILED = $C0000142
STATUS_MISSING_SYSTEMFILE = $C0000143
STATUS_UNHANDLED_EXCEPTION = $C0000144
STATUS_APP_INIT_FAILURE = $C0000145
STATUS_PAGEFILE_CREATE_FAILED = $C0000146
STATUS_NO_PAGEFILE = $C0000147
STATUS_INVALID_LEVEL = $C0000148
STATUS_WRONG_PASSWORD_CORE = $C0000149
STATUS_ILLEGAL_FLOAT_CONTEXT = $C000014A
STATUS_PIPE_BROKEN = $C000014B
STATUS_REGISTRY_CORRUPT = $C000014C
STATUS_REGISTRY_IO_FAILED = $C000014D
STATUS_NO_EVENT_PAIR = $C000014E
STATUS_UNRECOGNIZED_VOLUME = $C000014F
STATUS_SERIAL_NO_DEVICE_INITED = $C0000150
STATUS_NO_SUCH_ALIAS = $C0000151
STATUS_MEMBER_NOT_IN_ALIAS = $C0000152
STATUS_MEMBER_IN_ALIAS = $C0000153
STATUS_ALIAS_EXISTS = $C0000154
STATUS_LOGON_NOT_GRANTED = $C0000155
STATUS_TOO_MANY_SECRETS = $C0000156
STATUS_SECRET_TOO_LONG = $C0000157
STATUS_INTERNAL_DB_ERROR = $C0000158
STATUS_FULLSCREEN_MODE = $C0000159
STATUS_TOO_MANY_CONTEXT_IDS = $C000015A
STATUS_LOGON_TYPE_NOT_GRANTED = $C000015B
STATUS_NOT_REGISTRY_FILE = $C000015C
STATUS_NT_CROSS_ENCRYPTION_REQUIRED = $C000015D
STATUS_DOMAIN_CTRLR_CONFIG_ERROR = $C000015E
STATUS_FT_MISSING_MEMBER = $C000015F
STATUS_ILL_FORMED_SERVICE_ENTRY = $C0000160
STATUS_ILLEGAL_CHARACTER = $C0000161
STATUS_UNMAPPABLE_CHARACTER = $C0000162
STATUS_UNDEFINED_CHARACTER = $C0000163
STATUS_FLOPPY_VOLUME = $C0000164
STATUS_FLOPPY_ID_MARK_NOT_FOUND = $C0000165
STATUS_FLOPPY_WRONG_CYLINDER = $C0000166
STATUS_FLOPPY_UNKNOWN_ERROR = $C0000167
STATUS_FLOPPY_BAD_REGISTERS = $C0000168
STATUS_DISK_RECALIBRATE_FAILED = $C0000169
STATUS_DISK_OPERATION_FAILED = $C000016A
STATUS_DISK_RESET_FAILED = $C000016B
STATUS_SHARED_IRQ_BUSY = $C000016C
STATUS_FT_ORPHANING = $C000016D
STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT  = $C000016E
STATUS_PARTITION_FAILURE = $C0000172
STATUS_INVALID_BLOCK_LENGTH = $C0000173
STATUS_DEVICE_NOT_PARTITIONED = $C0000174
STATUS_UNABLE_TO_LOCK_MEDIA = $C0000175
STATUS_UNABLE_TO_UNLOAD_MEDIA = $C0000176
STATUS_EOM_OVERFLOW = $C0000177
STATUS_NO_MEDIA = $C0000178
STATUS_NO_SUCH_MEMBER = $C000017A
STATUS_INVALID_MEMBER = $C000017B
STATUS_KEY_DELETED = $C000017C
STATUS_NO_LOG_SPACE = $C000017D
STATUS_TOO_MANY_SIDS = $C000017E
STATUS_LM_CROSS_ENCRYPTION_REQUIRED  = $C000017F
STATUS_KEY_HAS_CHILDREN = $C0000180
STATUS_CHILD_MUST_BE_VOLATILE = $C0000181
STATUS_DEVICE_CONFIGURATION_ERROR = $C0000182
STATUS_DRIVER_INTERNAL_ERROR = $C0000183
STATUS_INVALID_DEVICE_STATE = $C0000184
STATUS_IO_DEVICE_ERROR = $C0000185
STATUS_DEVICE_PROTOCOL_ERROR = $C0000186
STATUS_BACKUP_CONTROLLER = $C0000187
STATUS_LOG_FILE_FULL = $C0000188
STATUS_TOO_LATE = $C0000189
STATUS_NO_TRUST_LSA_SECRET = $C000018A
STATUS_NO_TRUST_SAM_ACCOUNT = $C000018B
STATUS_TRUSTED_DOMAIN_FAILURE = $C000018C
STATUS_TRUSTED_RELATIONSHIP_FAILURE = $C000018D
STATUS_EVENTLOG_FILE_CORRUPT = $C000018E
STATUS_EVENTLOG_CANT_START = $C000018F
STATUS_TRUST_FAILURE = $C0000190
STATUS_MUTANT_LIMIT_EXCEEDED = $C0000191
STATUS_NETLOGON_NOT_STARTED = $C0000192
STATUS_ACCOUNT_EXPIRED = $C0000193
STATUS_POSSIBLE_DEADLOCK = $C0000194
STATUS_NETWORK_CREDENTIAL_CONFLICT = $C0000195
STATUS_REMOTE_SESSION_LIMIT = $C0000196
STATUS_EVENTLOG_FILE_CHANGED = $C0000197
STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT = $C0000198
STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT = $C0000199
STATUS_NOLOGON_SERVER_TRUST_ACCOUNT = $C000019A
STATUS_DOMAIN_TRUST_INCONSISTENT = $C000019B
STATUS_FS_DRIVER_REQUIRED = $C000019C
STATUS_NO_USER_SESSION_KEY = $C0000202
STATUS_USER_SESSION_DELETED = $C0000203
STATUS_RESOURCE_LANG_NOT_FOUND = $C0000204
STATUS_INSUFF_SERVER_RESOURCES = $C0000205
STATUS_INVALID_BUFFER_SIZE = $C0000206
STATUS_INVALID_ADDRESS_COMPONENT = $C0000207
STATUS_INVALID_ADDRESS_WILDCARD = $C0000208
STATUS_TOO_MANY_ADDRESSES = $C0000209
STATUS_ADDRESS_ALREADY_EXISTS = $C000020A
STATUS_ADDRESS_CLOSED = $C000020B
STATUS_CONNECTION_DISCONNECTED = $C000020C
STATUS_CONNECTION_RESET = $C000020D
STATUS_TOO_MANY_NODES = $C000020E
STATUS_TRANSACTION_ABORTED = $C000020F
STATUS_TRANSACTION_TIMED_OUT = $C0000210
STATUS_TRANSACTION_NO_RELEASE = $C0000211
STATUS_TRANSACTION_NO_MATCH = $C0000212
STATUS_TRANSACTION_RESPONDED = $C0000213
STATUS_TRANSACTION_INVALID_ID = $C0000214
STATUS_TRANSACTION_INVALID_TYPE = $C0000215
STATUS_NOT_SERVER_SESSION = $C0000216
STATUS_NOT_CLIENT_SESSION = $C0000217
STATUS_CANNOT_LOAD_REGISTRY_FILE = $C0000218
STATUS_DEBUG_ATTACH_FAILED = $C0000219
STATUS_SYSTEM_PROCESS_TERMINATED = $C000021A
STATUS_DATA_NOT_ACCEPTED = $C000021B
STATUS_NO_BROWSER_SERVERS_FOUND = $C000021C
STATUS_VDM_HARD_ERROR = $C000021D
STATUS_DRIVER_CANCEL_TIMEOUT = $C000021E
STATUS_REPLY_MESSAGE_MISMATCH = $C000021F
STATUS_MAPPED_ALIGNMENT = $C0000220
STATUS_IMAGE_CHECKSUM_MISMATCH = $C0000221
STATUS_LOST_WRITEBEHIND_DATA   = $C0000222
STATUS_CLIENT_SERVER_PARAMETERS_INVALID  = $C0000223
STATUS_PASSWORD_MUST_CHANGE = $C0000224
STATUS_NOT_FOUND = $C0000225
STATUS_NOT_TINY_STREAM = $C0000226
STATUS_RECOVERY_FAILURE = $C0000227
STATUS_STACK_OVERFLOW_READ = $C0000228
STATUS_FAIL_CHECK = $C0000229
STATUS_DUPLICATE_OBJECTID = $C000022A
STATUS_OBJECTID_EXISTS = $C000022B
STATUS_CONVERT_TO_LARGE = $C000022C
STATUS_RETRY = $C000022D
STATUS_FOUND_OUT_OF_SCOPE = $C000022E
STATUS_ALLOCATE_BUCKET = $C000022F
STATUS_PROPSET_NOT_FOUND = $C0000230
STATUS_MARSHALL_OVERFLOW = $C0000231
STATUS_INVALID_VARIANT = $C0000232
STATUS_DOMAIN_CONTROLLER_NOT_FOUND = $C0000233
STATUS_ACCOUNT_LOCKED_OUT = $C0000234
STATUS_HANDLE_NOT_CLOSABLE = $C0000235
STATUS_CONNECTION_REFUSED = $C0000236
STATUS_GRACEFUL_DISCONNECT = $C0000237
STATUS_ADDRESS_ALREADY_ASSOCIATED = $C0000238
STATUS_ADDRESS_NOT_ASSOCIATED = $C0000239
STATUS_CONNECTION_INVALID = $C000023A
STATUS_CONNECTION_ACTIVE = $C000023B
STATUS_NETWORK_UNREACHABLE = $C000023C
STATUS_HOST_UNREACHABLE = $C000023D
STATUS_PROTOCOL_UNREACHABLE = $C000023E
STATUS_PORT_UNREACHABLE = $C000023F
STATUS_REQUEST_ABORTED = $C0000240
STATUS_CONNECTION_ABORTED = $C0000241
STATUS_BAD_COMPRESSION_BUFFER = $C0000242
STATUS_USER_MAPPED_FILE = $C0000243
STATUS_AUDIT_FAILED = $C0000244
STATUS_TIMER_RESOLUTION_NOT_SET = $C0000245
STATUS_CONNECTION_COUNT_LIMIT = $C0000246
STATUS_LOGIN_TIME_RESTRICTION = $C0000247
STATUS_LOGIN_WKSTA_RESTRICTION = $C0000248
STATUS_IMAGE_MP_UP_MISMATCH = $C0000249
STATUS_INSUFFICIENT_LOGON_INFO = $C0000250
STATUS_BAD_DLL_ENTRYPOINT = $C0000251
STATUS_BAD_SERVICE_ENTRYPOINT = $C0000252
STATUS_LPC_REPLY_LOST = $C0000253
STATUS_IP_ADDRESS_CONFLICT1 = $C0000254
STATUS_IP_ADDRESS_CONFLICT2 = $C0000255
STATUS_REGISTRY_QUOTA_LIMIT = $C0000256
STATUS_PATH_NOT_COVERED = $C0000257
STATUS_NO_CALLBACK_ACTIVE = $C0000258
STATUS_LICENSE_QUOTA_EXCEEDED  = $C0000259
STATUS_PWD_TOO_SHORT = $C000025A
STATUS_PWD_TOO_RECENT = $C000025B
STATUS_PWD_HISTORY_CONFLICT = $C000025C
STATUS_PLUGPLAY_NO_DEVICE = $C000025E
STATUS_UNSUPPORTED_COMPRESSION = $C000025F
STATUS_INVALID_HW_PROFILE = $C0000260
STATUS_INVALID_PLUGPLAY_DEVICE_PATH = $C0000261
STATUS_DRIVER_ORDINAL_NOT_FOUND = $C0000262
STATUS_DRIVER_ENTRYPOINT_NOT_FOUND = $C0000263
STATUS_RESOURCE_NOT_OWNED = $C0000264
STATUS_TOO_MANY_LINKS = $C0000265
STATUS_QUOTA_LIST_INCONSISTENT = $C0000266
STATUS_FILE_IS_OFFLINE = $C0000267
STATUS_EVALUATION_EXPIRATION = $C0000268
STATUS_ILLEGAL_DLL_RELOCATION = $C0000269
STATUS_LICENSE_VIOLATION = $C000026A
STATUS_DLL_INIT_FAILED_LOGOFF = $C000026B
STATUS_DRIVER_UNABLE_TO_LOAD = $C000026C
STATUS_DFS_UNAVAILABLE = $C000026D
STATUS_VOLUME_DISMOUNTED = $C000026E
STATUS_WX86_INTERNAL_ERROR = $C000026F
STATUS_WX86_FLOAT_STACK_CHECK = $C0000270
STATUS_VALIDATE_CONTINUE = $C0000271
STATUS_NO_MATCH = $C0000272
STATUS_NO_MORE_MATCHES = $C0000273
STATUS_NOT_A_REPARSE_POINT = $C0000275
STATUS_IO_REPARSE_TAG_INVALID = $C0000276
STATUS_IO_REPARSE_TAG_MISMATCH = $C0000277
STATUS_IO_REPARSE_DATA_INVALID = $C0000278
STATUS_IO_REPARSE_TAG_NOT_HANDLED = $C0000279
STATUS_REPARSE_POINT_NOT_RESOLVED = $C0000280
STATUS_DIRECTORY_IS_A_REPARSE_POINT = $C0000281
STATUS_RANGE_LIST_CONFLICT = $C0000282
STATUS_SOURCE_ELEMENT_EMPTY = $C0000283
STATUS_DESTINATION_ELEMENT_FULL = $C0000284
STATUS_ILLEGAL_ELEMENT_ADDRESS = $C0000285
STATUS_MAGAZINE_NOT_PRESENT = $C0000286
STATUS_REINITIALIZATION_NEEDED = $C0000287
STATUS_DEVICE_REQUIRES_CLEANING = $80000288
STATUS_DEVICE_DOOR_OPEN = $80000289
STATUS_ENCRYPTION_FAILED = $C000028A
STATUS_DECRYPTION_FAILED = $C000028B
STATUS_RANGE_NOT_FOUND = $C000028C
STATUS_NO_RECOVERY_POLICY = $C000028D
STATUS_NO_EFS = $C000028E
STATUS_WRONG_EFS = $C000028F
STATUS_NO_USER_KEYS = $C0000290
STATUS_FILE_NOT_ENCRYPTED = $C0000291
STATUS_NOT_EXPORT_FORMAT = $C0000292
STATUS_FILE_ENCRYPTED = $C0000293
STATUS_WAKE_SYSTEM = $40000294
STATUS_WMI_GUID_NOT_FOUND = $C0000295
STATUS_WMI_INSTANCE_NOT_FOUND = $C0000296
STATUS_WMI_ITEMID_NOT_FOUND = $C0000297
STATUS_WMI_TRY_AGAIN = $C0000298
STATUS_SHARED_POLICY = $C0000299
STATUS_POLICY_OBJECT_NOT_FOUND = $C000029A
STATUS_POLICY_ONLY_IN_DS = $C000029B
STATUS_VOLUME_NOT_UPGRADED = $C000029C
STATUS_REMOTE_STORAGE_NOT_ACTIVE = $C000029D
STATUS_REMOTE_STORAGE_MEDIA_ERROR = $C000029E
STATUS_NO_TRACKING_SERVICE = $C000029F
STATUS_SERVER_SID_MISMATCH = $C00002A0
STATUS_DS_NO_ATTRIBUTE_OR_VALUE = $C00002A1
STATUS_DS_INVALID_ATTRIBUTE_SYNTAX = $C00002A2
STATUS_DS_ATTRIBUTE_TYPE_UNDEFINED = $C00002A3
STATUS_DS_ATTRIBUTE_OR_VALUE_EXISTS = $C00002A4
STATUS_DS_BUSY = $C00002A5
STATUS_DS_UNAVAILABLE = $C00002A6
STATUS_DS_NO_RIDS_ALLOCATED = $C00002A7
STATUS_DS_NO_MORE_RIDS = $C00002A8
STATUS_DS_INCORRECT_ROLE_OWNER = $C00002A9
STATUS_DS_RIDMGR_INIT_ERROR = $C00002AA
STATUS_DS_OBJ_CLASS_VIOLATION = $C00002AB
STATUS_DS_CANT_ON_NON_LEAF = $C00002AC
STATUS_DS_CANT_ON_RDN = $C00002AD
STATUS_DS_CANT_MOD_OBJ_CLASS = $C00002AE
STATUS_DS_CROSS_DOM_MOVE_FAILED = $C00002AF
STATUS_DS_GC_NOT_AVAILABLE = $C00002B0
STATUS_DIRECTORY_SERVICE_REQUIRED = $C00002B1
STATUS_REPARSE_ATTRIBUTE_CONFLICT = $C00002B2
STATUS_CANT_ENABLE_DENY_ONLY = $C00002B3
STATUS_FLOAT_MULTIPLE_FAULTS = $C00002B4
STATUS_FLOAT_MULTIPLE_TRAPS = $C00002B5
STATUS_DEVICE_REMOVED = $C00002B6
STATUS_JOURNAL_DELETE_IN_PROGRESS = $C00002B7
STATUS_JOURNAL_NOT_ACTIVE = $C00002B8
STATUS_NOINTERFACE = $C00002B9
STATUS_DS_ADMIN_LIMIT_EXCEEDED = $C00002C1
STATUS_DRIVER_FAILED_SLEEP = $C00002C2
STATUS_MUTUAL_AUTHENTICATION_FAILED = $C00002C3
STATUS_CORRUPT_SYSTEM_FILE = $C00002C4
STATUS_DATATYPE_MISALIGNMENT_ERROR = $C00002C5
STATUS_WMI_READ_ONLY = $C00002C6
STATUS_WMI_SET_FAILURE = $C00002C7
STATUS_COMMITMENT_MINIMUM = $C00002C8
STATUS_REG_NAT_CONSUMPTION = $C00002C9
STATUS_TRANSPORT_FULL = $C00002CA
STATUS_DS_SAM_INIT_FAILURE = $C00002CB
STATUS_ONLY_IF_CONNECTED = $C00002CC
STATUS_DS_SENSITIVE_GROUP_VIOLATION = $C00002CD
STATUS_PNP_RESTART_ENUMERATION = $C00002CE
STATUS_JOURNAL_ENTRY_DELETED = $C00002CF
STATUS_DS_CANT_MOD_PRIMARYGROUPID = $C00002D0
STATUS_SYSTEM_IMAGE_BAD_SIGNATURE = $C00002D1
STATUS_PNP_REBOOT_REQUIRED = $C00002D2
STATUS_POWER_STATE_INVALID = $C00002D3
STATUS_DS_INVALID_GROUP_TYPE = $C00002D4
STATUS_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN = $C00002D5
STATUS_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN = $C00002D6
STATUS_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER = $C00002D7
STATUS_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER  = $C00002D8
STATUS_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER = $C00002D9
STATUS_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER = $C00002DA
STATUS_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER = $C00002DB
STATUS_DS_HAVE_PRIMARY_MEMBERS = $C00002DC
STATUS_WMI_NOT_SUPPORTED = $C00002DD
STATUS_INSUFFICIENT_POWER = $C00002DE
STATUS_SAM_NEED_BOOTKEY_PASSWORD = $C00002DF
STATUS_SAM_NEED_BOOTKEY_FLOPPY = $C00002E0
STATUS_DS_CANT_START = $C00002E1
STATUS_DS_INIT_FAILURE = $C00002E2
STATUS_SAM_INIT_FAILURE = $C00002E3
STATUS_DS_GC_REQUIRED = $C00002E4
STATUS_DS_LOCAL_MEMBER_OF_LOCAL_ONLY = $C00002E5
STATUS_DS_NO_FPO_IN_UNIVERSAL_GROUPS = $C00002E6
STATUS_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED = $C00002E7
STATUS_MULTIPLE_FAULT_VIOLATION = $C00002E8
STATUS_CURRENT_DOMAIN_NOT_ALLOWED = $C00002E9
STATUS_CANNOT_MAKE = $C00002EA
STATUS_SYSTEM_SHUTDOWN = $C00002EB
STATUS_DS_INIT_FAILURE_CONSOLE = $C00002EC
STATUS_DS_SAM_INIT_FAILURE_CONSOLE = $C00002ED
STATUS_UNFINISHED_CONTEXT_DELETED = $C00002EE
STATUS_NO_TGT_REPLY = $C00002EF
STATUS_OBJECTID_NOT_FOUND = $C00002F0
STATUS_NO_IP_ADDRESSES = $C00002F1
STATUS_WRONG_CREDENTIAL_HANDLE = $C00002F2
STATUS_CRYPTO_SYSTEM_INVALID = $C00002F3
STATUS_MAX_REFERRALS_EXCEEDED = $C00002F4
STATUS_MUST_BE_KDC = $C00002F5
STATUS_STRONG_CRYPTO_NOT_SUPPORTED  = $C00002F6
STATUS_TOO_MANY_PRINCIPALS = $C00002F7
STATUS_NO_PA_DATA = $C00002F8
STATUS_PKINIT_NAME_MISMATCH = $C00002F9
STATUS_SMARTCARD_LOGON_REQUIRED = $C00002FA
STATUS_KDC_INVALID_REQUEST = $C00002FB
STATUS_KDC_UNABLE_TO_REFER = $C00002FC
STATUS_KDC_UNKNOWN_ETYPE = $C00002FD
STATUS_SHUTDOWN_IN_PROGRESS = $C00002FE
STATUS_SERVER_SHUTDOWN_IN_PROGRESS = $C00002FF
STATUS_NOT_SUPPORTED_ON_SBS = $C0000300
STATUS_WMI_GUID_DISCONNECTED = $C0000301
STATUS_WMI_ALREADY_DISABLED = $C0000302
STATUS_WMI_ALREADY_ENABLED = $C0000303
STATUS_MFT_TOO_FRAGMENTED = $C0000304
STATUS_COPY_PROTECTION_FAILURE = $C0000305
STATUS_CSS_AUTHENTICATION_FAILURE = $C0000306
STATUS_CSS_KEY_NOT_PRESENT = $C0000307
STATUS_CSS_KEY_NOT_ESTABLISHED = $C0000308
STATUS_CSS_SCRAMBLED_SECTOR = $C0000309
STATUS_CSS_REGION_MISMATCH = $C000030A
STATUS_CSS_RESETS_EXHAUSTED = $C000030B
STATUS_PKINIT_FAILURE = $C0000320
STATUS_SMARTCARD_SUBSYSTEM_FAILURE = $C0000321
STATUS_NO_KERB_KEY = $C0000322
STATUS_HOST_DOWN = $C0000350
STATUS_UNSUPPORTED_PREAUTH = $C0000351
STATUS_EFS_ALG_BLOB_TOO_BIG = $C0000352
STATUS_PORT_NOT_SET = $C0000353
STATUS_DEBUGGER_INACTIVE = $C0000354
STATUS_DS_VERSION_CHECK_FAILURE = $C0000355
STATUS_AUDITING_DISABLED = $C0000356
STATUS_PRENT4_MACHINE_ACCOUNT = $C0000357
STATUS_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER  = $C0000358
STATUS_INVALID_IMAGE_WIN_32 = $C0000359
STATUS_INVALID_IMAGE_WIN_64 = $C000035A
STATUS_BAD_BINDINGS = $C000035B
STATUS_NETWORK_SESSION_EXPIRED = $C000035C
STATUS_APPHELP_BLOCK = $C000035D
STATUS_ALL_SIDS_FILTERED = $C000035E
STATUS_NOT_SAFE_MODE_DRIVER = $C000035F
STATUS_ACCESS_DISABLED_BY_POLICY_DEFAULT = $C0000361
STATUS_ACCESS_DISABLED_BY_POLICY_PATH = $C0000362
STATUS_ACCESS_DISABLED_BY_POLICY_PUBLISHER = $C0000363
STATUS_ACCESS_DISABLED_BY_POLICY_OTHER = $C0000364
STATUS_FAILED_DRIVER_ENTRY = $C0000365
STATUS_DEVICE_ENUMERATION_ERROR = $C0000366
STATUS_WAIT_FOR_OPLOCK = $00000367
STATUS_MOUNT_POINT_NOT_RESOLVED = $C0000368
STATUS_INVALID_DEVICE_OBJECT_PARAMETER	= $C0000369
STATUS_MCA_OCCURED = $C000036A
STATUS_DRIVER_BLOCKED_CRITICAL = $C000036B
STATUS_DRIVER_BLOCKED = $C000036C
STATUS_DRIVER_DATABASE_ERROR = $C000036D
STATUS_SYSTEM_HIVE_TOO_LARGE = $C000036E
STATUS_INVALID_IMPORT_OF_NON_DLL  = $C000036F
STATUS_DS_SHUTTING_DOWN = $40000370
STATUS_SMARTCARD_WRONG_PIN = $C0000380
STATUS_SMARTCARD_CARD_BLOCKED = $C0000381
STATUS_SMARTCARD_CARD_NOT_AUTHENTICATED = $C0000382
STATUS_SMARTCARD_NO_CARD = $C0000383
STATUS_SMARTCARD_NO_KEY_CONTAINER = $C0000384
STATUS_SMARTCARD_NO_CERTIFICATE= $C0000385
STATUS_SMARTCARD_NO_KEYSET = $C0000386
STATUS_SMARTCARD_IO_ERROR = $C0000387
STATUS_DOWNGRADE_DETECTED = $C0000388
STATUS_SMARTCARD_CERT_REVOKED = $C0000389
STATUS_ISSUING_CA_UNTRUSTED = $C000038A
STATUS_REVOCATION_OFFLINE_C = $C000038B
STATUS_PKINIT_CLIENT_FAILURE = $C000038C
STATUS_SMARTCARD_CERT_EXPIRED = $C000038D
STATUS_DRIVER_FAILED_PRIOR_UNLOAD = $C000038E
STATUS_SMARTCARD_SILENT_CONTEXT = $C000038F
STATUS_PER_USER_TRUST_QUOTA_EXCEEDED = $C0000401
STATUS_ALL_USER_TRUST_QUOTA_EXCEEDED = $C0000402
STATUS_USER_DELETE_TRUST_QUOTA_EXCEEDED = $C0000403
STATUS_DS_NAME_NOT_UNIQUE = $C0000404
STATUS_DS_DUPLICATE_ID_FOUND = $C0000405
STATUS_DS_GROUP_CONVERSION_ERROR = $C0000406
STATUS_VOLSNAP_PREPARE_HIBERNATE = $C0000407
STATUS_USER2USER_REQUIRED = $C0000408
STATUS_STACK_BUFFER_OVERRUN = $C0000409
STATUS_NO_S4U_PROT_SUPPORT = $C000040A
STATUS_CROSSREALM_DELEGATION_FAILURE = $C000040B
STATUS_REVOCATION_OFFLINE_KDC = $C000040C
STATUS_ISSUING_CA_UNTRUSTED_KDC = $C000040D
STATUS_KDC_CERT_EXPIRED = $C000040E
STATUS_KDC_CERT_REVOKED = $C000040F
STATUS_PARAMETER_QUOTA_EXCEEDED = $C0000410
STATUS_HIBERNATION_FAILURE = $C0000411
STATUS_DELAY_LOAD_FAILED = $C0000412
STATUS_AUTHENTICATION_FIREWALL_FAILED = $C0000413
STATUS_VDM_DISALLOWED = $C0000414
STATUS_HUNG_DISPLAY_DRIVER_THREAD = $C0000415
STATUS_ASSERTION_FAILURE = $C0000420
STATUS_CALLBACK_POP_STACK = $C0000423
STATUS_INCOMPATIBLE_DRIVER_BLOCKED = $C0000424
STATUS_ENCOUNTERED_WRITE_IN_PROGRESS = $C0000433
STATUS_WOW_ASSERTION = $C0009898

DBG_NO_STATE_CHANGE = $C0010001
DBG_APP_NOT_IDLE = $C0010002

RPC_NT_INVALID_STRING_BINDING = $C0020001
RPC_NT_WRONG_KIND_OF_BINDING = $C0020002
RPC_NT_INVALID_BINDING = $C0020003
RPC_NT_PROTSEQ_NOT_SUPPORTED = $C0020004
RPC_NT_INVALID_RPC_PROTSEQ = $C0020005
RPC_NT_INVALID_STRING_UUID = $C0020006
RPC_NT_INVALID_ENDPOINT_FORMAT = $C0020007
RPC_NT_INVALID_NET_ADDR = $C0020008
RPC_NT_NO_ENDPOINT_FOUND = $C0020009
RPC_NT_INVALID_TIMEOUT = $C002000A
RPC_NT_OBJECT_NOT_FOUND = $C002000B
RPC_NT_ALREADY_REGISTERED = $C002000C
RPC_NT_TYPE_ALREADY_REGISTERED = $C002000D
RPC_NT_ALREADY_LISTENING = $C002000E
RPC_NT_NO_PROTSEQS_REGISTERED = $C002000F
RPC_NT_NOT_LISTENING = $C0020010
RPC_NT_UNKNOWN_MGR_TYPE = $C0020011
RPC_NT_UNKNOWN_IF = $C0020012
RPC_NT_NO_BINDINGS = $C0020013
RPC_NT_NO_PROTSEQS = $C0020014
RPC_NT_CANT_CREATE_ENDPOINT = $C0020015
RPC_NT_OUT_OF_RESOURCES = $C0020016
RPC_NT_SERVER_UNAVAILABLE = $C0020017
RPC_NT_SERVER_TOO_BUSY = $C0020018
RPC_NT_INVALID_NETWORK_OPTIONS = $C0020019
RPC_NT_NO_CALL_ACTIVE  = $C002001A
RPC_NT_CALL_FAILED = $C002001B
RPC_NT_CALL_FAILED_DNE = $C002001C
RPC_NT_PROTOCOL_ERROR = $C002001D
RPC_NT_UNSUPPORTED_TRANS_SYN = $C002001F
RPC_NT_UNSUPPORTED_TYPE = $C0020021
RPC_NT_INVALID_TAG = $C0020022
RPC_NT_INVALID_BOUND = $C0020023
RPC_NT_NO_ENTRY_NAME = $C0020024
RPC_NT_INVALID_NAME_SYNTAX = $C0020025
RPC_NT_UNSUPPORTED_NAME_SYNTAX = $C0020026
RPC_NT_UUID_NO_ADDRESS = $C0020028
RPC_NT_DUPLICATE_ENDPOINT = $C0020029
RPC_NT_UNKNOWN_AUTHN_TYPE = $C002002A
RPC_NT_MAX_CALLS_TOO_SMALL = $C002002B
RPC_NT_STRING_TOO_LONG = $C002002C
RPC_NT_PROTSEQ_NOT_FOUND = $C002002D
RPC_NT_PROCNUM_OUT_OF_RANGE = $C002002E
RPC_NT_BINDING_HAS_NO_AUTH = $C002002F
RPC_NT_UNKNOWN_AUTHN_SERVICE = $C0020030
RPC_NT_UNKNOWN_AUTHN_LEVEL = $C0020031
RPC_NT_INVALID_AUTH_IDENTITY = $C0020032
RPC_NT_UNKNOWN_AUTHZ_SERVICE = $C0020033

EPT_NT_INVALID_ENTRY = $C0020034
EPT_NT_CANT_PERFORM_OP = $C0020035
EPT_NT_NOT_REGISTERED = $C0020036

RPC_NT_NOTHING_TO_EXPORT = $C0020037
RPC_NT_INCOMPLETE_NAME = $C0020038
RPC_NT_INVALID_VERS_OPTION = $C0020039
RPC_NT_NO_MORE_MEMBERS = $C002003A
RPC_NT_NOT_ALL_OBJS_UNEXPORTED = $C002003B
RPC_NT_INTERFACE_NOT_FOUND = $C002003C
RPC_NT_ENTRY_ALREADY_EXISTS = $C002003D
RPC_NT_ENTRY_NOT_FOUND = $C002003E
RPC_NT_NAME_SERVICE_UNAVAILABLE   = $C002003F
RPC_NT_INVALID_NAF_ID = $C0020040
RPC_NT_CANNOT_SUPPORT = $C0020041
RPC_NT_NO_CONTEXT_AVAILABLE = $C0020042
RPC_NT_INTERNAL_ERROR = $C0020043
RPC_NT_ZERO_DIVIDE = $C0020044
RPC_NT_ADDRESS_ERROR = $C0020045
RPC_NT_FP_DIV_ZERO = $C0020046
RPC_NT_FP_UNDERFLOW = $C0020047
RPC_NT_FP_OVERFLOW = $C0020048
RPC_NT_NO_MORE_ENTRIES = $C0030001
RPC_NT_SS_CHAR_TRANS_OPEN_FAIL = $C0030002
RPC_NT_SS_CHAR_TRANS_SHORT_FILE = $C0030003
RPC_NT_SS_IN_NULL_CONTEXT = $C0030004
RPC_NT_SS_CONTEXT_MISMATCH = $C0030005
RPC_NT_SS_CONTEXT_DAMAGED = $C0030006
RPC_NT_SS_HANDLES_MISMATCH = $C0030007
RPC_NT_SS_CANNOT_GET_CALL_HANDLE = $C0030008
RPC_NT_NULL_REF_POINTER = $C0030009
RPC_NT_ENUM_VALUE_OUT_OF_RANGE = $C003000A
RPC_NT_BYTE_COUNT_TOO_SMALL = $C003000B
RPC_NT_BAD_STUB_DATA = $C003000C
RPC_NT_CALL_IN_PROGRESS = $C0020049
RPC_NT_NO_MORE_BINDINGS = $C002004A
RPC_NT_GROUP_MEMBER_NOT_FOUND = $C002004B

EPT_NT_CANT_CREATE = $C002004C

RPC_NT_INVALID_OBJECT = $C002004D
RPC_NT_NO_INTERFACES = $C002004F
RPC_NT_CALL_CANCELLED = $C0020050
RPC_NT_BINDING_INCOMPLETE = $C0020051
RPC_NT_COMM_FAILURE = $C0020052
RPC_NT_UNSUPPORTED_AUTHN_LEVEL = $C0020053
RPC_NT_NO_PRINC_NAME = $C0020054
RPC_NT_NOT_RPC_ERROR = $C0020055
RPC_NT_UUID_LOCAL_ONLY = $40020056
RPC_NT_SEC_PKG_ERROR = $C0020057
RPC_NT_NOT_CANCELLED = $C0020058
RPC_NT_INVALID_ES_ACTION = $C0030059
RPC_NT_WRONG_ES_VERSION = $C003005A
RPC_NT_WRONG_STUB_VERSION = $C003005B
RPC_NT_INVALID_PIPE_OBJECT = $C003005C
RPC_NT_INVALID_PIPE_OPERATION = $C003005D
RPC_NT_WRONG_PIPE_VERSION = $C003005E
RPC_NT_PIPE_CLOSED = $C003005F
RPC_NT_PIPE_DISCIPLINE_ERROR = $C0030060
RPC_NT_PIPE_EMPTY = $C0030061
RPC_NT_INVALID_ASYNC_HANDLE = $C0020062
RPC_NT_INVALID_ASYNC_CALL = $C0020063
RPC_NT_SEND_INCOMPLETE = $400200AF

STATUS_ACPI_INVALID_OPCODE = $C0140001
STATUS_ACPI_STACK_OVERFLOW = $C0140002
STATUS_ACPI_ASSERT_FAILED = $C0140003
STATUS_ACPI_INVALID_INDEX = $C0140004
STATUS_ACPI_INVALID_ARGUMENT = $C0140005
STATUS_ACPI_FATAL = $C0140006
STATUS_ACPI_INVALID_SUPERNAME = $C0140007
STATUS_ACPI_INVALID_ARGTYPE = $C0140008
STATUS_ACPI_INVALID_OBJTYPE = $C0140009
STATUS_ACPI_INVALID_TARGETTYPE = $C014000A
STATUS_ACPI_INCORRECT_ARGUMENT_COUNT = $C014000B
STATUS_ACPI_ADDRESS_NOT_MAPPED = $C014000C
STATUS_ACPI_INVALID_EVENTTYPE = $C014000D
STATUS_ACPI_HANDLER_COLLISION = $C014000E
STATUS_ACPI_INVALID_DATA = $C014000F
STATUS_ACPI_INVALID_REGION = $C0140010
STATUS_ACPI_INVALID_ACCESS_SIZE = $C0140011
STATUS_ACPI_ACQUIRE_GLOBAL_LOCK = $C0140012
STATUS_ACPI_ALREADY_INITIALIZED = $C0140013
STATUS_ACPI_NOT_INITIALIZED = $C0140014
STATUS_ACPI_INVALID_MUTEX_LEVEL = $C0140015
STATUS_ACPI_MUTEX_NOT_OWNED = $C0140016
STATUS_ACPI_MUTEX_NOT_OWNER = $C0140017
STATUS_ACPI_RS_ACCESS = $C0140018
STATUS_ACPI_INVALID_TABLE = $C0140019
STATUS_ACPI_REG_HANDLER_FAILED = $C0140020
STATUS_ACPI_POWER_REQUEST_FAILED = $C0140021
STATUS_CTX_WINSTATION_NAME_INVALID = $C00A0001
STATUS_CTX_INVALID_PD = $C00A0002
STATUS_CTX_PD_NOT_FOUND = $C00A0003
STATUS_CTX_CDM_CONNECT = $400A0004
STATUS_CTX_CDM_DISCONNECT = $400A0005
STATUS_CTX_CLOSE_PENDING = $C00A0006
STATUS_CTX_NO_OUTBUF = $C00A0007
STATUS_CTX_MODEM_INF_NOT_FOUND = $C00A0008
STATUS_CTX_INVALID_MODEMNAME = $C00A0009
STATUS_CTX_RESPONSE_ERROR = $C00A000A
STATUS_CTX_MODEM_RESPONSE_TIMEOUT = $C00A000B
STATUS_CTX_MODEM_RESPONSE_NO_CARRIER = $C00A000C
STATUS_CTX_MODEM_RESPONSE_NO_DIALTONE = $C00A000D
STATUS_CTX_MODEM_RESPONSE_BUSY = $C00A000E
STATUS_CTX_MODEM_RESPONSE_VOICE = $C00A000F
STATUS_CTX_TD_ERROR = $C00A0010
STATUS_CTX_LICENSE_CLIENT_INVALID = $C00A0012
STATUS_CTX_LICENSE_NOT_AVAILABLE = $C00A0013
STATUS_CTX_LICENSE_EXPIRED = $C00A0014
STATUS_CTX_WINSTATION_NOT_FOUND = $C00A0015
STATUS_CTX_WINSTATION_NAME_COLLISION = $C00A0016
STATUS_CTX_WINSTATION_BUSY = $C00A0017
STATUS_CTX_BAD_VIDEO_MODE = $C00A0018
STATUS_CTX_GRAPHICS_INVALID = $C00A0022
STATUS_CTX_NOT_CONSOLE = $C00A0024
STATUS_CTX_CLIENT_QUERY_TIMEOUT = $C00A0026
STATUS_CTX_CONSOLE_DISCONNECT = $C00A0027
STATUS_CTX_CONSOLE_CONNECT = $C00A0028
STATUS_CTX_SHADOW_DENIED = $C00A002A
STATUS_CTX_WINSTATION_ACCESS_DENIED = $C00A002B
STATUS_CTX_INVALID_WD = $C00A002E
STATUS_CTX_WD_NOT_FOUND = $C00A002F
STATUS_CTX_SHADOW_INVALID = $C00A0030
STATUS_CTX_SHADOW_DISABLED = $C00A0031
STATUS_RDP_PROTOCOL_ERROR = $C00A0032
STATUS_CTX_CLIENT_LICENSE_NOT_SET = $C00A0033
STATUS_CTX_CLIENT_LICENSE_IN_USE = $C00A0034
STATUS_CTX_SHADOW_ENDED_BY_MODE_CHANGE = $C00A0035
STATUS_CTX_SHADOW_NOT_RUNNING = $C00A0036
STATUS_PNP_BAD_MPS_TABLE = $C0040035
STATUS_PNP_TRANSLATION_FAILED = $C0040036
STATUS_PNP_IRQ_TRANSLATION_FAILED = $C0040037
STATUS_PNP_INVALID_ID = $C0040038
STATUS_SXS_SECTION_NOT_FOUND = $C0150001
STATUS_SXS_CANT_GEN_ACTCTX = $C0150002
STATUS_SXS_INVALID_ACTCTXDATA_FORMAT = $C0150003
STATUS_SXS_ASSEMBLY_NOT_FOUND = $C0150004
STATUS_SXS_MANIFEST_FORMAT_ERROR = $C0150005
STATUS_SXS_MANIFEST_PARSE_ERROR = $C0150006
STATUS_SXS_ACTIVATION_CONTEXT_DISABLED	= $C0150007
STATUS_SXS_KEY_NOT_FOUND = $C0150008
STATUS_SXS_VERSION_CONFLICT = $C0150009
STATUS_SXS_WRONG_SECTION_TYPE = $C015000A
STATUS_SXS_THREAD_QUERIES_DISABLED = $C015000B
STATUS_SXS_ASSEMBLY_MISSING = $C015000C
STATUS_SXS_RELEASE_ACTIVATION_CONTEXT = $4015000D
STATUS_SXS_PROCESS_DEFAULT_ALREADY_SET = $C015000E
STATUS_SXS_EARLY_DEACTIVATION = $C015000F
STATUS_SXS_INVALID_DEACTIVATION = $C0150010
STATUS_SXS_MULTIPLE_DEACTIVATION = $C0150011
STATUS_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY = $C0150012
STATUS_SXS_PROCESS_TERMINATION_REQUESTED = $C0150013
STATUS_SXS_CORRUPT_ACTIVATION_STACK = $C0150014
STATUS_SXS_CORRUPTION = $C0150015
STATUS_CLUSTER_INVALID_NODE = $C0130001
STATUS_CLUSTER_NODE_EXISTS = $C0130002
STATUS_CLUSTER_JOIN_IN_PROGRESS = $C0130003
STATUS_CLUSTER_NODE_NOT_FOUND = $C0130004
STATUS_CLUSTER_LOCAL_NODE_NOT_FOUND = $C0130005
STATUS_CLUSTER_NETWORK_EXISTS = $C0130006
STATUS_CLUSTER_NETWORK_NOT_FOUND = $C0130007
STATUS_CLUSTER_NETINTERFACE_EXISTS = $C0130008
STATUS_CLUSTER_NETINTERFACE_NOT_FOUND = $C0130009
STATUS_CLUSTER_INVALID_REQUEST = $C013000A
STATUS_CLUSTER_INVALID_NETWORK_PROVIDER = $C013000B
STATUS_CLUSTER_NODE_DOWN = $C013000C
STATUS_CLUSTER_NODE_UNREACHABLE = $C013000D
STATUS_CLUSTER_NODE_NOT_MEMBER = $C013000E
STATUS_CLUSTER_JOIN_NOT_IN_PROGRESS = $C013000F
STATUS_CLUSTER_INVALID_NETWORK = $C0130010
STATUS_CLUSTER_NO_NET_ADAPTERS = $C0130011
STATUS_CLUSTER_NODE_UP = $C0130012
STATUS_CLUSTER_NODE_PAUSED = $C0130013
STATUS_CLUSTER_NODE_NOT_PAUSED = $C0130014
STATUS_CLUSTER_NO_SECURITY_CONTEXT = $C0130015
STATUS_CLUSTER_NETWORK_NOT_INTERNAL = $C0130016
STATUS_CLUSTER_POISONED = $C0130017
STATUS_LOG_SECTOR_INVALID = $C01A0001
STATUS_LOG_SECTOR_PARITY_INVALID = $C01A0002
STATUS_LOG_SECTOR_REMAPPED = $C01A0003
STATUS_LOG_BLOCK_INCOMPLETE = $C01A0004
STATUS_LOG_INVALID_RANGE = $C01A0005
STATUS_LOG_BLOCKS_EXHAUSTED = $C01A0006
STATUS_LOG_READ_CONTEXT_INVALID = $C01A0007
STATUS_LOG_RESTART_INVALID = $C01A0008
STATUS_LOG_BLOCK_VERSION = $C01A0009
STATUS_LOG_BLOCK_INVALID = $C01A000A
STATUS_LOG_READ_MODE_INVALID = $C01A000B
STATUS_LOG_NO_RESTART = $401A000C
STATUS_LOG_METADATA_CORRUPT = $C01A000D
STATUS_LOG_METADATA_INVALID = $C01A000E
STATUS_LOG_METADATA_INCONSISTENT = $C01A000F
STATUS_LOG_RESERVATION_INVALID = $C01A0010
STATUS_LOG_CANT_DELETE = $C01A0011
STATUS_LOG_CONTAINER_LIMIT_EXCEEDED  = $C01A0012
STATUS_LOG_START_OF_LOG = $C01A0013
STATUS_LOG_POLICY_ALREADY_INSTALLED  = $C01A0014
STATUS_LOG_POLICY_NOT_INSTALLED = $C01A0015
STATUS_LOG_POLICY_INVALID = $C01A0016
STATUS_LOG_POLICY_CONFLICT = $C01A0017
STATUS_LOG_PINNED_ARCHIVE_TAIL = $C01A0018
STATUS_LOG_RECORD_NONEXISTENT = $C01A0019
STATUS_LOG_RECORDS_RESERVED_INVALID = $C01A001A
STATUS_LOG_SPACE_RESERVED_INVALID = $C01A001B
STATUS_LOG_TAIL_INVALID = $C01A001C
STATUS_LOG_FULL = $C01A001D
STATUS_LOG_MULTIPLEXED = $C01A001E
STATUS_LOG_DEDICATED = $C01A001F
STATUS_LOG_ARCHIVE_NOT_IN_PROGRESS = $C01A0020
STATUS_LOG_ARCHIVE_IN_PROGRESS = $C01A0021
STATUS_LOG_EPHEMERAL = $C01A0022
STATUS_LOG_NOT_ENOUGH_CONTAINERS = $C01A0023
STATUS_LOG_CLIENT_ALREADY_REGISTERED = $C01A0024
STATUS_LOG_CLIENT_NOT_REGISTERED = $C01A0025
STATUS_LOG_FULL_HANDLER_IN_PROGRESS = $C01A0026
STATUS_LOG_CONTAINER_READ_FAILED = $C01A0027
STATUS_LOG_CONTAINER_WRITE_FAILED = $C01A0028
STATUS_LOG_CONTAINER_OPEN_FAILED = $C01A0029
STATUS_LOG_CONTAINER_STATE_INVALID = $C01A002A
STATUS_LOG_STATE_INVALID = $C01A002B
STATUS_LOG_PINNED = $C01A002C
STATUS_LOG_METADATA_FLUSH_FAILED = $C01A002D
STATUS_LOG_INCONSISTENT_SECURITY = $C01A002E
STATUS_COULD_NOT_RESIZE_LOG = $80190009

;winerror.h --  error code definitions for the Win32 API functions
;Copyright (c) Microsoft Corp.  All rights reserved.
FACILITY_WINDOWSUPDATE = 36
FACILITY_WINDOWS_CE = 24
FACILITY_WINDOWS = 8
FACILITY_URT = 19
FACILITY_UMI = 22
FACILITY_SXS = 23
FACILITY_STORAGE = 3
FACILITY_STATE_MANAGEMENT = 34
FACILITY_SSPI = 9
FACILITY_SCARD = 16
FACILITY_SETUPAPI = 15
FACILITY_SECURITY = 9
FACILITY_RPC = 1
FACILITY_WIN32 = 7
FACILITY_CONTROL = 10
FACILITY_NULL = 0
FACILITY_METADIRECTORY = 35
FACILITY_MSMQ = 14
FACILITY_MEDIASERVER = 13
FACILITY_INTERNET = 12
FACILITY_ITF = 4
FACILITY_HTTP = 25
FACILITY_DPLAY = 21
FACILITY_DISPATCH = 2
FACILITY_DIRECTORYSERVICE = 37
FACILITY_CONFIGURATION	= 33
FACILITY_COMPLUS = 17
FACILITY_CERT = 11
FACILITY_BACKGROUNDCOPY = 32
FACILITY_ACS = 20
FACILITY_AAF = 18

ERROR_SUCCESS = 0
NO_ERROR = 0
SEC_E_OK = 0

ERROR_INVALID_FUNCTION = 1
ERROR_FILE_NOT_FOUND = 2
ERROR_PATH_NOT_FOUND = 3
ERROR_TOO_MANY_OPEN_FILES = 4
ERROR_ACCESS_DENIED = 5
ERROR_INVALID_HANDLE = 6
ERROR_ARENA_TRASHED = 7
ERROR_NOT_ENOUGH_MEMORY = 8
ERROR_INVALID_BLOCK = 9
ERROR_BAD_ENVIRONMENT = 10

ERROR_BAD_FORMAT = 11
ERROR_INVALID_ACCESS = 12
ERROR_INVALID_DATA = 13
ERROR_OUTOFMEMORY = 14
ERROR_INVALID_DRIVE = 15
ERROR_CURRENT_DIRECTORY = 16
ERROR_NOT_SAME_DEVICE = 17
ERROR_NO_MORE_FILES = 18
ERROR_WRITE_PROTECT = 19
ERROR_BAD_UNIT = 20
ERROR_NOT_READY = 21
ERROR_BAD_COMMAND = 22
ERROR_CRC = 23
ERROR_BAD_LENGTH  = 24
ERROR_SEEK = 25
ERROR_NOT_DOS_DISK = 26
ERROR_SECTOR_NOT_FOUND = 27
ERROR_OUT_OF_PAPER = 28
ERROR_WRITE_FAULT = 29
ERROR_READ_FAULT = 30
ERROR_GEN_FAILURE = 31
ERROR_SHARING_VIOLATION = 32
ERROR_LOCK_VIOLATION = 33
ERROR_WRONG_DISK = 34
ERROR_SHARING_BUFFER_EXCEEDED = 36
ERROR_HANDLE_EOF = 38
ERROR_HANDLE_DISK_FULL = 39
ERROR_NOT_SUPPORTED = 50
ERROR_REM_NOT_LIST = 51
ERROR_DUP_NAME = 52
ERROR_BAD_NETPATH = 53
ERROR_NETWORK_BUSY = 54
ERROR_DEV_NOT_EXIST = 55
ERROR_TOO_MANY_CMDS = 56
ERROR_ADAP_HDW_ERR = 57
ERROR_BAD_NET_RESP = 58
ERROR_UNEXP_NET_ERR = 59
ERROR_BAD_REM_ADAP = 60
ERROR_PRINTQ_FULL = 61
ERROR_NO_SPOOL_SPACE = 62
ERROR_PRINT_CANCELLED = 63
ERROR_NETNAME_DELETED = 64
ERROR_NETWORK_ACCESS_DENIED	 = 65
ERROR_BAD_DEV_TYPE = 66
ERROR_BAD_NET_NAME = 67
ERROR_TOO_MANY_NAMES = 68
ERROR_TOO_MANY_SESS = 69
ERROR_SHARING_PAUSED = 70
ERROR_REQ_NOT_ACCEP = 71
ERROR_REDIR_PAUSED = 72
ERROR_FILE_EXISTS = 80
ERROR_CANNOT_MAKE = 82
ERROR_FAIL_I24 = 83
ERROR_OUT_OF_STRUCTURES = 84
ERROR_ALREADY_ASSIGNED = 85
ERROR_INVALID_PASSWORD = 86
ERROR_INVALID_PARAMETER = 87
ERROR_NET_WRITE_FAULT = 88
ERROR_NO_PROC_SLOTS = 89
ERROR_TOO_MANY_SEMAPHORES = 100
ERROR_EXCL_SEM_ALREADY_OWNED = 101
ERROR_SEM_IS_SET = 102
ERROR_TOO_MANY_SEM_REQUESTS = 103
ERROR_INVALID_AT_INTERRUPT_TIME  = 104
ERROR_SEM_OWNER_DIED = 105
ERROR_SEM_USER_LIMIT = 106
ERROR_DISK_CHANGE = 107
ERROR_DRIVE_LOCKED = 108
ERROR_BROKEN_PIPE = 109
ERROR_OPEN_FAILED = 110
ERROR_BUFFER_OVERFLOW = 111
ERROR_DISK_FULL = 112
ERROR_NO_MORE_SEARCH_HANDLES = 113
ERROR_INVALID_TARGET_HANDLE = 114
ERROR_INVALID_CATEGORY = 117
ERROR_INVALID_VERIFY_SWITCH = 118
ERROR_BAD_DRIVER_LEVEL = 119
ERROR_CALL_NOT_IMPLEMENTED  = 120
ERROR_SEM_TIMEOUT = 121
ERROR_INSUFFICIENT_BUFFER = 122
ERROR_INVALID_NAME = 123
ERROR_INVALID_LEVEL = 124
ERROR_NO_VOLUME_LABEL = 125
ERROR_MOD_NOT_FOUND = 126
ERROR_PROC_NOT_FOUND = 127
ERROR_WAIT_NO_CHILDREN = 128
ERROR_CHILD_NOT_COMPLETE = 129
ERROR_DIRECT_ACCESS_HANDLE = 130
ERROR_NEGATIVE_SEEK = 131
ERROR_SEEK_ON_DEVICE = 132
ERROR_IS_JOIN_TARGET = 133
ERROR_IS_JOINED = 134
ERROR_IS_SUBSTED = 135
ERROR_NOT_JOINED = 136
ERROR_NOT_SUBSTED = 137
ERROR_JOIN_TO_JOIN = 138
ERROR_SUBST_TO_SUBST = 139
ERROR_JOIN_TO_SUBST = 140
ERROR_SUBST_TO_JOIN = 141
ERROR_BUSY_DRIVE = 142
ERROR_SAME_DRIVE = 143
ERROR_DIR_NOT_ROOT = 144
ERROR_DIR_NOT_EMPTY = 145
ERROR_IS_SUBST_PATH = 146
ERROR_IS_JOIN_PATH = 147
ERROR_PATH_BUSY = 148
ERROR_IS_SUBST_TARGET = 149
ERROR_SYSTEM_TRACE = 150
ERROR_INVALID_EVENT_COUNT = 151
ERROR_TOO_MANY_MUXWAITERS = 152
ERROR_INVALID_LIST_FORMAT = 153
ERROR_LABEL_TOO_LONG = 154
ERROR_TOO_MANY_TCBS = 155
ERROR_SIGNAL_REFUSED = 156
ERROR_DISCARDED = 157
ERROR_NOT_LOCKED = 158
ERROR_BAD_THREADID_ADDR = 159
ERROR_BAD_ARGUMENTS = 160
ERROR_BAD_PATHNAME = 161
ERROR_SIGNAL_PENDING = 162
ERROR_MAX_THRDS_REACHED = 164
ERROR_LOCK_FAILED = 167
ERROR_BUSY = 170
ERROR_CANCEL_VIOLATION = 173
ERROR_ATOMIC_LOCKS_NOT_SUPPORTED = 174
ERROR_INVALID_SEGMENT_NUMBER = 180
ERROR_INVALID_ORDINAL = 182
ERROR_ALREADY_EXISTS = 183
ERROR_INVALID_FLAG_NUMBER = 186
ERROR_SEM_NOT_FOUND = 187
ERROR_INVALID_STARTING_CODESEG = 188
ERROR_INVALID_STACKSEG = 189
ERROR_INVALID_MODULETYPE = 190
ERROR_INVALID_EXE_SIGNATURE = 191
ERROR_EXE_MARKED_INVALID = 192
ERROR_BAD_EXE_FORMAT = 193
ERROR_ITERATED_DATA_EXCEEDS_64k = 194
ERROR_INVALID_MINALLOCSIZE = 195
ERROR_DYNLINK_FROM_INVALID_RING = 196
ERROR_IOPL_NOT_ENABLED = 197
ERROR_INVALID_SEGDPL = 198
ERROR_AUTODATASEG_EXCEEDS_64k = 199
ERROR_RING2SEG_MUST_BE_MOVABLE = 200
ERROR_RELOC_CHAIN_XEEDS_SEGLIM = 201
ERROR_INFLOOP_IN_RELOC_CHAIN = 202
ERROR_ENVVAR_NOT_FOUND = 203
ERROR_NO_SIGNAL_SENT = 205
ERROR_FILENAME_EXCED_RANGE = 206
ERROR_RING2_STACK_IN_USE = 207
ERROR_META_EXPANSION_TOO_LONG  = 208
ERROR_INVALID_SIGNAL_NUMBER = 209
ERROR_THREAD_1_INACTIVE = 210
ERROR_LOCKED = 212
ERROR_TOO_MANY_MODULES = 214
ERROR_NESTING_NOT_ALLOWED = 215
ERROR_EXE_MACHINE_TYPE_MISMATCH = 216
ERROR_EXE_CANNOT_MODIFY_SIGNED_BINARY = 217
ERROR_EXE_CANNOT_MODIFY_STRONG_SIGNED_BINARY = 218
ERROR_BAD_PIPE = 230
ERROR_PIPE_BUSY = 231
ERROR_NO_DATA = 232
ERROR_PIPE_NOT_CONNECTED = 233
ERROR_MORE_DATA = 234
ERROR_VC_DISCONNECTED = 240
ERROR_INVALID_EA_NAME = 254
ERROR_EA_LIST_INCONSISTENT = 255

WAIT_TIMEOUT = 258

ERROR_NO_MORE_ITEMS = 259
ERROR_CANNOT_COPY = 266
ERROR_DIRECTORY = 267
ERROR_EAS_DIDNT_FIT = 275
ERROR_EA_FILE_CORRUPT = 276
ERROR_EA_TABLE_FULL   = 277
ERROR_INVALID_EA_HANDLE = 278
ERROR_EAS_NOT_SUPPORTED = 282
ERROR_NOT_OWNER = 288
ERROR_TOO_MANY_POSTS = 298
ERROR_PARTIAL_COPY = 299
ERROR_OPLOCK_NOT_GRANTED = 300
ERROR_INVALID_OPLOCK_PROTOCOL = 301
ERROR_DISK_TOO_FRAGMENTED = 302
ERROR_DELETE_PENDING = 303
ERROR_MR_MID_NOT_FOUND = 317
ERROR_SCOPE_NOT_FOUND = 318
ERROR_INVALID_ADDRESS = 487
ERROR_ARITHMETIC_OVERFLOW = 534
ERROR_PIPE_CONNECTED = 535
ERROR_PIPE_LISTENING = 536
ERROR_EA_ACCESS_DENIED = 994
ERROR_OPERATION_ABORTED = 995
ERROR_IO_INCOMPLETE = 996
ERROR_IO_PENDING = 997
ERROR_NOACCESS = 998
ERROR_SWAPERROR = 999
ERROR_STACK_OVERFLOW = 1001
ERROR_INVALID_MESSAGE = 1002
ERROR_CAN_NOT_COMPLETE = 1003
ERROR_INVALID_FLAGS = 1004
ERROR_UNRECOGNIZED_VOLUME = 1005
ERROR_FILE_INVALID = 1006
ERROR_FULLSCREEN_MODE = 1007
ERROR_NO_TOKEN = 1008
ERROR_BADDB = 1009
ERROR_BADKEY = 1010
ERROR_CANTOPEN = 1011
ERROR_CANTREAD = 1012
ERROR_CANTWRITE = 1013
ERROR_REGISTRY_RECOVERED = 1014
ERROR_REGISTRY_CORRUPT = 1015
ERROR_REGISTRY_IO_FAILED = 1016
ERROR_NOT_REGISTRY_FILE = 1017
ERROR_KEY_DELETED = 1018
ERROR_NO_LOG_SPACE = 1019
ERROR_KEY_HAS_CHILDREN = 1020
ERROR_CHILD_MUST_BE_VOLATILE = 1021
ERROR_NOTIFY_ENUM_DIR = 1022
ERROR_DEPENDENT_SERVICES_RUNNING = 1051
ERROR_INVALID_SERVICE_CONTROL = 1052
ERROR_SERVICE_REQUEST_TIMEOUT = 1053
ERROR_SERVICE_NO_THREAD = 1054
ERROR_SERVICE_DATABASE_LOCKED = 1055
ERROR_SERVICE_ALREADY_RUNNING = 1056
ERROR_INVALID_SERVICE_ACCOUNT = 1057
ERROR_SERVICE_DISABLED = 1058
ERROR_CIRCULAR_DEPENDENCY = 1059
ERROR_SERVICE_DOES_NOT_EXIST = 1060
ERROR_SERVICE_CANNOT_ACCEPT_CTRL = 1061
ERROR_SERVICE_NOT_ACTIVE = 1062
ERROR_FAILED_SERVICE_CONTROLLER_CONNECT = 1063
ERROR_EXCEPTION_IN_SERVICE = 1064
ERROR_DATABASE_DOES_NOT_EXIST = 1065
ERROR_SERVICE_SPECIFIC_ERROR = 1066
ERROR_PROCESS_ABORTED = 1067
ERROR_SERVICE_DEPENDENCY_FAIL = 1068
ERROR_SERVICE_LOGON_FAILED = 1069
ERROR_SERVICE_START_HANG = 1070
ERROR_INVALID_SERVICE_LOCK = 1071
ERROR_SERVICE_MARKED_FOR_DELETE = 1072
ERROR_SERVICE_EXISTS = 1073
ERROR_ALREADY_RUNNING_LKG = 1074
ERROR_SERVICE_DEPENDENCY_DELETED = 1075
ERROR_BOOT_ALREADY_ACCEPTED = 1076
ERROR_SERVICE_NEVER_STARTED = 1077
ERROR_DUPLICATE_SERVICE_NAME = 1078
ERROR_DIFFERENT_SERVICE_ACCOUNT = 1079
ERROR_CANNOT_DETECT_DRIVER_FAILURE = 1080
ERROR_CANNOT_DETECT_PROCESS_ABORT = 1081
ERROR_NO_RECOVERY_PROGRAM = 1082
ERROR_SERVICE_NOT_IN_EXE = 1083
ERROR_NOT_SAFEBOOT_SERVICE = 1084
ERROR_END_OF_MEDIA = 1100
ERROR_FILEMARK_DETECTED = 1101
ERROR_BEGINNING_OF_MEDIA = 1102
ERROR_SETMARK_DETECTED = 1103
ERROR_NO_DATA_DETECTED = 1104
ERROR_PARTITION_FAILURE = 1105
ERROR_INVALID_BLOCK_LENGTH = 1106
ERROR_DEVICE_NOT_PARTITIONED = 1107
ERROR_UNABLE_TO_LOCK_MEDIA = 1108
ERROR_UNABLE_TO_UNLOAD_MEDIA = 1109
ERROR_MEDIA_CHANGED = 1110
ERROR_BUS_RESET = 1111
ERROR_NO_MEDIA_IN_DRIVE = 1112
ERROR_NO_UNICODE_TRANSLATION = 1113
ERROR_DLL_INIT_FAILED = 1114
ERROR_SHUTDOWN_IN_PROGRESS = 1115
ERROR_NO_SHUTDOWN_IN_PROGRESS = 1116
ERROR_IO_DEVICE = 1117
ERROR_SERIAL_NO_DEVICE = 1118
ERROR_IRQ_BUSY = 1119
ERROR_MORE_WRITES = 1120
ERROR_COUNTER_TIMEOUT  = 1121
ERROR_FLOPPY_ID_MARK_NOT_FOUND = 1122
ERROR_FLOPPY_WRONG_CYLINDER = 1123
ERROR_FLOPPY_UNKNOWN_ERROR = 1124
ERROR_FLOPPY_BAD_REGISTERS = 1125
ERROR_DISK_RECALIBRATE_FAILED = 1126
ERROR_DISK_OPERATION_FAILED = 1127
ERROR_DISK_RESET_FAILED = 1128
ERROR_EOM_OVERFLOW = 1129
ERROR_NOT_ENOUGH_SERVER_MEMORY = 1130
ERROR_POSSIBLE_DEADLOCK = 1131
ERROR_MAPPED_ALIGNMENT = 1132
ERROR_SET_POWER_STATE_VETOED = 1140
ERROR_SET_POWER_STATE_FAILED = 1141
ERROR_TOO_MANY_LINKS = 1142
ERROR_OLD_WIN_VERSION = 1150
ERROR_APP_WRONG_OS = 1151
ERROR_SINGLE_INSTANCE_APP = 1152
ERROR_RMODE_APP = 1153
ERROR_INVALID_DLL = 1154
ERROR_NO_ASSOCIATION = 1155
ERROR_DDE_FAIL = 1156
ERROR_DLL_NOT_FOUND = 1157
ERROR_NO_MORE_USER_HANDLES = 1158
ERROR_MESSAGE_SYNC_ONLY = 1159
ERROR_SOURCE_ELEMENT_EMPTY = 1160
ERROR_DESTINATION_ELEMENT_FULL = 1161
ERROR_ILLEGAL_ELEMENT_ADDRESS = 1162
ERROR_MAGAZINE_NOT_PRESENT = 1163
ERROR_DEVICE_REINITIALIZATION_NEEDED = 1164
ERROR_DEVICE_REQUIRES_CLEANING = 1165
ERROR_DEVICE_DOOR_OPEN = 1166
ERROR_DEVICE_NOT_CONNECTED = 1167
ERROR_NOT_FOUND = 1168
ERROR_NO_MATCH = 1169
ERROR_SET_NOT_FOUND = 1170
ERROR_POINT_NOT_FOUND = 1171
ERROR_NO_TRACKING_SERVICE = 1172
ERROR_NO_VOLUME_ID = 1173
ERROR_UNABLE_TO_REMOVE_REPLACED = 1175
ERROR_UNABLE_TO_MOVE_REPLACEMENT = 1176
ERROR_UNABLE_TO_MOVE_REPLACEMENT_2 = 1177
ERROR_JOURNAL_DELETE_IN_PROGRESS = 1178
ERROR_JOURNAL_NOT_ACTIVE = 1179
ERROR_POTENTIAL_FILE_FOUND = 1180
ERROR_JOURNAL_ENTRY_DELETED = 1181
ERROR_BAD_DEVICE = 1200
ERROR_CONNECTION_UNAVAIL = 1201
ERROR_DEVICE_ALREADY_REMEMBERED  = 1202
ERROR_NO_NET_OR_BAD_PATH = 1203
ERROR_BAD_PROVIDER = 1204
ERROR_CANNOT_OPEN_PROFILE  = 1205
ERROR_BAD_PROFILE = 1206
ERROR_NOT_CONTAINER = 1207
ERROR_EXTENDED_ERROR = 1208
ERROR_INVALID_GROUPNAME = 1209
ERROR_INVALID_COMPUTERNAME = 1210
ERROR_INVALID_EVENTNAME = 1211
ERROR_INVALID_DOMAINNAME = 1212
ERROR_INVALID_SERVICENAME = 1213
ERROR_INVALID_NETNAME = 1214
ERROR_INVALID_SHARENAME = 1215
ERROR_INVALID_PASSWORDNAME = 1216
ERROR_INVALID_MESSAGENAME = 1217
ERROR_INVALID_MESSAGEDEST = 1218
ERROR_SESSION_CREDENTIAL_CONFLICT = 1219
ERROR_REMOTE_SESSION_LIMIT_EXCEEDED = 1220
ERROR_DUP_DOMAINNAME = 1221
ERROR_NO_NETWORK = 1222
ERROR_CANCELLED = 1223
ERROR_USER_MAPPED_FILE = 1224
ERROR_CONNECTION_REFUSED = 1225
ERROR_GRACEFUL_DISCONNECT = 1226
ERROR_ADDRESS_ALREADY_ASSOCIATED = 1227
ERROR_ADDRESS_NOT_ASSOCIATED = 1228
ERROR_CONNECTION_INVALID = 1229
ERROR_CONNECTION_ACTIVE = 1230
ERROR_NETWORK_UNREACHABLE = 1231
ERROR_HOST_UNREACHABLE = 1232
ERROR_PROTOCOL_UNREACHABLE = 1233
ERROR_PORT_UNREACHABLE = 1234
ERROR_REQUEST_ABORTED = 1235
ERROR_CONNECTION_ABORTED = 1236
ERROR_RETRY = 1237
ERROR_CONNECTION_COUNT_LIMIT = 1238
ERROR_LOGIN_TIME_RESTRICTION = 1239
ERROR_LOGIN_WKSTA_RESTRICTION = 1240
ERROR_INCORRECT_ADDRESS = 1241
ERROR_ALREADY_REGISTERED = 1242
ERROR_SERVICE_NOT_FOUND = 1243
ERROR_NOT_AUTHENTICATED = 1244
ERROR_NOT_LOGGED_ON = 1245
ERROR_CONTINUE = 1246
ERROR_ALREADY_INITIALIZED = 1247
ERROR_NO_MORE_DEVICES = 1248
ERROR_NO_SUCH_SITE = 1249
ERROR_DOMAIN_CONTROLLER_EXISTS = 1250
ERROR_ONLY_IF_CONNECTED = 1251
ERROR_OVERRIDE_NOCHANGES = 1252
ERROR_BAD_USER_PROFILE = 1253
ERROR_NOT_SUPPORTED_ON_SBS = 1254
ERROR_SERVER_SHUTDOWN_IN_PROGRESS = 1255
ERROR_HOST_DOWN = 1256
ERROR_NON_ACCOUNT_SID = 1257
ERROR_NON_DOMAIN_SID = 1258
ERROR_APPHELP_BLOCK = 1259
ERROR_ACCESS_DISABLED_BY_POLICY = 1260
ERROR_REG_NAT_CONSUMPTION = 1261
ERROR_CSCSHARE_OFFLINE = 1262
ERROR_PKINIT_FAILURE = 1263
ERROR_SMARTCARD_SUBSYSTEM_FAILURE = 1264
ERROR_DOWNGRADE_DETECTED = 1265
ERROR_MACHINE_LOCKED = 1271
ERROR_CALLBACK_SUPPLIED_INVALID_DATA = 1273
ERROR_SYNC_FOREGROUND_REFRESH_REQUIRED = 1274
ERROR_DRIVER_BLOCKED = 1275
ERROR_INVALID_IMPORT_OF_NON_DLL = 1276
ERROR_ACCESS_DISABLED_WEBBLADE = 1277
ERROR_ACCESS_DISABLED_WEBBLADE_TAMPER = 1278
ERROR_RECOVERY_FAILURE = 1279
ERROR_ALREADY_FIBER = 1280
ERROR_ALREADY_THREAD = 1281
ERROR_STACK_BUFFER_OVERRUN = 1282
ERROR_PARAMETER_QUOTA_EXCEEDED = 1283
ERROR_DEBUGGER_INACTIVE = 1284
ERROR_DELAY_LOAD_FAILED = 1285
ERROR_VDM_DISALLOWED = 1286
ERROR_UNIDENTIFIED_ERROR = 1287
ERROR_NOT_ALL_ASSIGNED = 1300
ERROR_SOME_NOT_MAPPED = 1301
ERROR_NO_QUOTAS_FOR_ACCOUNT = 1302
ERROR_LOCAL_USER_SESSION_KEY = 1303
ERROR_NULL_LM_PASSWORD = 1304
ERROR_UNKNOWN_REVISION = 1305
ERROR_REVISION_MISMATCH = 1306
ERROR_INVALID_OWNER = 1307
ERROR_INVALID_PRIMARY_GROUP = 1308
ERROR_NO_IMPERSONATION_TOKEN = 1309
ERROR_CANT_DISABLE_MANDATORY = 1310
ERROR_NO_LOGON_SERVERS = 1311
ERROR_NO_SUCH_LOGON_SESSION = 1312
ERROR_NO_SUCH_PRIVILEGE = 1313
ERROR_PRIVILEGE_NOT_HELD = 1314
ERROR_INVALID_ACCOUNT_NAME = 1315
ERROR_USER_EXISTS = 1316
ERROR_NO_SUCH_USER = 1317
ERROR_GROUP_EXISTS = 1318
ERROR_NO_SUCH_GROUP = 1319
ERROR_MEMBER_IN_GROUP = 1320
ERROR_MEMBER_NOT_IN_GROUP = 1321
ERROR_LAST_ADMIN = 1322
ERROR_WRONG_PASSWORD = 1323
ERROR_ILL_FORMED_PASSWORD = 1324
ERROR_PASSWORD_RESTRICTION = 1325
ERROR_LOGON_FAILURE = 1326
ERROR_ACCOUNT_RESTRICTION = 1327
ERROR_INVALID_LOGON_HOURS = 1328
ERROR_INVALID_WORKSTATION = 1329
ERROR_PASSWORD_EXPIRED = 1330
ERROR_ACCOUNT_DISABLED = 1331
ERROR_NONE_MAPPED = 1332
ERROR_TOO_MANY_LUIDS_REQUESTED = 1333
ERROR_LUIDS_EXHAUSTED = 1334
ERROR_INVALID_SUB_AUTHORITY = 1335
ERROR_INVALID_ACL = 1336
ERROR_INVALID_SID = 1337
ERROR_INVALID_SECURITY_DESCR = 1338
ERROR_BAD_INHERITANCE_ACL = 1340
ERROR_SERVER_DISABLED = 1341
ERROR_SERVER_NOT_DISABLED = 1342
ERROR_INVALID_ID_AUTHORITY = 1343
ERROR_ALLOTTED_SPACE_EXCEEDED = 1344
ERROR_INVALID_GROUP_ATTRIBUTES = 1345
ERROR_BAD_IMPERSONATION_LEVEL = 1346
ERROR_CANT_OPEN_ANONYMOUS = 1347
ERROR_BAD_VALIDATION_CLASS = 1348
ERROR_BAD_TOKEN_TYPE = 1349
ERROR_NO_SECURITY_ON_OBJECT = 1350
ERROR_CANT_ACCESS_DOMAIN_INFO = 1351
ERROR_INVALID_SERVER_STATE = 1352
ERROR_INVALID_DOMAIN_STATE = 1353
ERROR_INVALID_DOMAIN_ROLE = 1354
ERROR_NO_SUCH_DOMAIN = 1355
ERROR_DOMAIN_EXISTS = 1356
ERROR_DOMAIN_LIMIT_EXCEEDED = 1357
ERROR_INTERNAL_DB_CORRUPTION = 1358
ERROR_INTERNAL_ERROR = 1359
ERROR_GENERIC_NOT_MAPPED = 1360
ERROR_BAD_DESCRIPTOR_FORMAT = 1361
ERROR_NOT_LOGON_PROCESS = 1362
ERROR_LOGON_SESSION_EXISTS = 1363
ERROR_NO_SUCH_PACKAGE = 1364
ERROR_BAD_LOGON_SESSION_STATE = 1365
ERROR_LOGON_SESSION_COLLISION = 1366
ERROR_INVALID_LOGON_TYPE = 1367
ERROR_CANNOT_IMPERSONATE = 1368
ERROR_RXACT_INVALID_STATE = 1369
ERROR_RXACT_COMMIT_FAILURE = 1370
ERROR_SPECIAL_ACCOUNT = 1371
ERROR_SPECIAL_GROUP = 1372
ERROR_SPECIAL_USER = 1373
ERROR_MEMBERS_PRIMARY_GROUP = 1374
ERROR_TOKEN_ALREADY_IN_USE = 1375
ERROR_NO_SUCH_ALIAS = 1376
ERROR_MEMBER_NOT_IN_ALIAS = 1377
ERROR_MEMBER_IN_ALIAS = 1378
ERROR_ALIAS_EXISTS = 1379
ERROR_LOGON_NOT_GRANTED = 1380
ERROR_TOO_MANY_SECRETS = 1381
ERROR_SECRET_TOO_LONG = 1382
ERROR_INTERNAL_DB_ERROR = 1383
ERROR_TOO_MANY_CONTEXT_IDS = 1384
ERROR_LOGON_TYPE_NOT_GRANTED = 1385
ERROR_NT_CROSS_ENCRYPTION_REQUIRED = 1386
ERROR_NO_SUCH_MEMBER = 1387
ERROR_INVALID_MEMBER = 1388
ERROR_TOO_MANY_SIDS = 1389
ERROR_LM_CROSS_ENCRYPTION_REQUIRED = 1390
ERROR_NO_INHERITANCE = 1391
ERROR_FILE_CORRUPT = 1392
ERROR_DISK_CORRUPT = 1393
ERROR_NO_USER_SESSION_KEY = 1394
ERROR_LICENSE_QUOTA_EXCEEDED = 1395
ERROR_WRONG_TARGET_NAME = 1396
ERROR_MUTUAL_AUTH_FAILED = 1397
ERROR_TIME_SKEW = 1398
ERROR_CURRENT_DOMAIN_NOT_ALLOWED = 1399
ERROR_INVALID_WINDOW_HANDLE = 1400
ERROR_INVALID_MENU_HANDLE = 1401
ERROR_INVALID_CURSOR_HANDLE = 1402
ERROR_INVALID_ACCEL_HANDLE = 1403
ERROR_INVALID_HOOK_HANDLE = 1404
ERROR_INVALID_DWP_HANDLE = 1405
ERROR_TLW_WITH_WSCHILD = 1406
ERROR_CANNOT_FIND_WND_CLASS = 1407
ERROR_WINDOW_OF_OTHER_THREAD = 1408
ERROR_HOTKEY_ALREADY_REGISTERED = 1409
ERROR_CLASS_ALREADY_EXISTS = 1410
ERROR_CLASS_DOES_NOT_EXIST = 1411
ERROR_CLASS_HAS_WINDOWS = 1412
ERROR_INVALID_INDEX = 1413
ERROR_INVALID_ICON_HANDLE = 1414
ERROR_PRIVATE_DIALOG_INDEX = 1415
ERROR_LISTBOX_ID_NOT_FOUND = 1416
ERROR_NO_WILDCARD_CHARACTERS = 1417
ERROR_CLIPBOARD_NOT_OPEN = 1418
ERROR_HOTKEY_NOT_REGISTERED = 1419
ERROR_WINDOW_NOT_DIALOG = 1420
ERROR_CONTROL_ID_NOT_FOUND = 1421
ERROR_INVALID_COMBOBOX_MESSAGE = 1422
ERROR_WINDOW_NOT_COMBOBOX = 1423
ERROR_INVALID_EDIT_HEIGHT = 1424
ERROR_DC_NOT_FOUND = 1425
ERROR_INVALID_HOOK_FILTER = 1426
ERROR_INVALID_FILTER_PROC = 1427
ERROR_HOOK_NEEDS_HMOD = 1428
ERROR_GLOBAL_ONLY_HOOK = 1429
ERROR_JOURNAL_HOOK_SET = 1430
ERROR_HOOK_NOT_INSTALLED = 1431
ERROR_INVALID_LB_MESSAGE = 1432
ERROR_SETCOUNT_ON_BAD_LB = 1433
ERROR_LB_WITHOUT_TABSTOPS = 1434
ERROR_DESTROY_OBJECT_OF_OTHER_THREAD = 1435
ERROR_CHILD_WINDOW_MENU = 1436
ERROR_NO_SYSTEM_MENU = 1437
ERROR_INVALID_MSGBOX_STYLE = 1438
ERROR_INVALID_SPI_VALUE = 1439
ERROR_SCREEN_ALREADY_LOCKED = 1440
ERROR_HWNDS_HAVE_DIFF_PARENT = 1441
ERROR_NOT_CHILD_WINDOW = 1442
ERROR_INVALID_GW_COMMAND = 1443
ERROR_INVALID_THREAD_ID = 1444
ERROR_NON_MDICHILD_WINDOW = 1445
ERROR_POPUP_ALREADY_ACTIVE = 1446
ERROR_NO_SCROLLBARS = 1447
ERROR_INVALID_SCROLLBAR_RANGE = 1448
ERROR_INVALID_SHOWWIN_COMMAND = 1449
ERROR_NO_SYSTEM_RESOURCES = 1450
ERROR_NONPAGED_SYSTEM_RESOURCES = 1451
ERROR_PAGED_SYSTEM_RESOURCES = 1452
ERROR_WORKING_SET_QUOTA = 1453
ERROR_PAGEFILE_QUOTA = 1454
ERROR_COMMITMENT_LIMIT = 1455
ERROR_MENU_ITEM_NOT_FOUND = 1456
ERROR_INVALID_KEYBOARD_HANDLE = 1457
ERROR_HOOK_TYPE_NOT_ALLOWED = 1458
ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION = 1459
ERROR_TIMEOUT = 1460
ERROR_INVALID_MONITOR_HANDLE = 1461
ERROR_INCORRECT_SIZE = 1462
ERROR_EVENTLOG_FILE_CORRUPT = 1500
ERROR_EVENTLOG_CANT_START = 1501
ERROR_LOG_FILE_FULL = 1502
ERROR_EVENTLOG_FILE_CHANGED = 1503
ERROR_INSTALL_SERVICE_FAILURE = 1601
ERROR_INSTALL_USEREXIT = 1602
ERROR_INSTALL_FAILURE = 1603
ERROR_INSTALL_SUSPEND = 1604
ERROR_UNKNOWN_PRODUCT = 1605
ERROR_UNKNOWN_FEATURE = 1606
ERROR_UNKNOWN_COMPONENT = 1607
ERROR_UNKNOWN_PROPERTY = 1608
ERROR_INVALID_HANDLE_STATE = 1609
ERROR_BAD_CONFIGURATION = 1610
ERROR_INDEX_ABSENT = 1611
ERROR_INSTALL_SOURCE_ABSENT = 1612
ERROR_INSTALL_PACKAGE_VERSION = 1613
ERROR_PRODUCT_UNINSTALLED = 1614
ERROR_BAD_QUERY_SYNTAX = 1615
ERROR_INVALID_FIELD = 1616
ERROR_DEVICE_REMOVED = 1617
ERROR_INSTALL_ALREADY_RUNNING = 1618
ERROR_INSTALL_PACKAGE_OPEN_FAILED = 1619
ERROR_INSTALL_PACKAGE_INVALID = 1620
ERROR_INSTALL_UI_FAILURE = 1621
ERROR_INSTALL_LOG_FAILURE = 1622
ERROR_INSTALL_LANGUAGE_UNSUPPORTED = 1623
ERROR_INSTALL_TRANSFORM_FAILURE  = 1624
ERROR_INSTALL_PACKAGE_REJECTED = 1625
ERROR_FUNCTION_NOT_CALLED = 1626
ERROR_FUNCTION_FAILED = 1627
ERROR_INVALID_TABLE = 1628
ERROR_DATATYPE_MISMATCH = 1629
ERROR_UNSUPPORTED_TYPE = 1630
ERROR_CREATE_FAILED = 1631
ERROR_INSTALL_TEMP_UNWRITABLE = 1632
ERROR_INSTALL_PLATFORM_UNSUPPORTED = 1633
ERROR_INSTALL_NOTUSED = 1634
ERROR_PATCH_PACKAGE_OPEN_FAILED = 1635
ERROR_PATCH_PACKAGE_INVALID = 1636
ERROR_PATCH_PACKAGE_UNSUPPORTED = 1637
ERROR_PRODUCT_VERSION = 1638
ERROR_INVALID_COMMAND_LINE = 1639
ERROR_INSTALL_REMOTE_DISALLOWED = 1640
ERROR_SUCCESS_REBOOT_INITIATED = 1641
ERROR_PATCH_TARGET_NOT_FOUND = 1642
ERROR_PATCH_PACKAGE_REJECTED = 1643
ERROR_INSTALL_TRANSFORM_REJECTED = 1644
ERROR_INSTALL_REMOTE_PROHIBITED = 1645

RPC_S_INVALID_STRING_BINDING = 1700
RPC_S_WRONG_KIND_OF_BINDING = 1701
RPC_S_INVALID_BINDING = 1702
RPC_S_PROTSEQ_NOT_SUPPORTED = 1703
RPC_S_INVALID_RPC_PROTSEQ = 1704
RPC_S_INVALID_STRING_UUID = 1705
RPC_S_INVALID_ENDPOINT_FORMAT = 1706
RPC_S_INVALID_NET_ADDR = 1707
RPC_S_NO_ENDPOINT_FOUND = 1708
RPC_S_INVALID_TIMEOUT = 1709
RPC_S_OBJECT_NOT_FOUND = 1710
RPC_S_ALREADY_REGISTERED = 1711
RPC_S_TYPE_ALREADY_REGISTERED = 1712
RPC_S_ALREADY_LISTENING = 1713
RPC_S_NO_PROTSEQS_REGISTERED = 1714
RPC_S_NOT_LISTENING = 1715
RPC_S_UNKNOWN_MGR_TYPE = 1716
RPC_S_UNKNOWN_IF = 1717
RPC_S_NO_BINDINGS = 1718
RPC_S_NO_PROTSEQS = 1719
RPC_S_CANT_CREATE_ENDPOINT = 1720
RPC_S_OUT_OF_RESOURCES = 1721
RPC_S_SERVER_UNAVAILABLE = 1722
RPC_S_SERVER_TOO_BUSY = 1723
RPC_S_INVALID_NETWORK_OPTIONS = 1724
RPC_S_NO_CALL_ACTIVE = 1725
RPC_S_CALL_FAILED = 1726
RPC_S_CALL_FAILED_DNE = 1727
RPC_S_PROTOCOL_ERROR = 1728
RPC_S_UNSUPPORTED_TRANS_SYN = 1730
RPC_S_UNSUPPORTED_TYPE = 1732
RPC_S_INVALID_TAG = 1733
RPC_S_INVALID_BOUND = 1734
RPC_S_NO_ENTRY_NAME = 1735
RPC_S_INVALID_NAME_SYNTAX   = 1736
RPC_S_UNSUPPORTED_NAME_SYNTAX	 = 1737
RPC_S_UUID_NO_ADDRESS = 1739
RPC_S_DUPLICATE_ENDPOINT = 1740
RPC_S_UNKNOWN_AUTHN_TYPE = 1741
RPC_S_MAX_CALLS_TOO_SMALL = 1742
RPC_S_STRING_TOO_LONG = 1743
RPC_S_PROTSEQ_NOT_FOUND = 1744
RPC_S_PROCNUM_OUT_OF_RANGE = 1745
RPC_S_BINDING_HAS_NO_AUTH = 1746
RPC_S_UNKNOWN_AUTHN_SERVICE = 1747
RPC_S_UNKNOWN_AUTHN_LEVEL = 1748
RPC_S_INVALID_AUTH_IDENTITY = 1749
RPC_S_UNKNOWN_AUTHZ_SERVICE = 1750

EPT_S_INVALID_ENTRY = 1751
EPT_S_CANT_PERFORM_OP = 1752
EPT_S_NOT_REGISTERED = 1753

RPC_S_NOTHING_TO_EXPORT = 1754
RPC_S_INCOMPLETE_NAME = 1755
RPC_S_INVALID_VERS_OPTION = 1756
RPC_S_NO_MORE_MEMBERS = 1757
RPC_S_NOT_ALL_OBJS_UNEXPORTED = 1758
RPC_S_INTERFACE_NOT_FOUND = 1759
RPC_S_ENTRY_ALREADY_EXISTS = 1760
RPC_S_ENTRY_NOT_FOUND = 1761
RPC_S_NAME_SERVICE_UNAVAILABLE = 1762
RPC_S_INVALID_NAF_ID = 1763
RPC_S_CANNOT_SUPPORT = 1764
RPC_S_NO_CONTEXT_AVAILABLE = 1765
RPC_S_INTERNAL_ERROR = 1766
RPC_S_ZERO_DIVIDE = 1767
RPC_S_ADDRESS_ERROR = 1768
RPC_S_FP_DIV_ZERO = 1769
RPC_S_FP_UNDERFLOW = 1770
RPC_S_FP_OVERFLOW = 1771
RPC_X_NO_MORE_ENTRIES = 1772
RPC_X_SS_CHAR_TRANS_OPEN_FAIL = 1773
RPC_X_SS_CHAR_TRANS_SHORT_FILE = 1774
RPC_X_SS_IN_NULL_CONTEXT = 1775
RPC_X_SS_CONTEXT_DAMAGED = 1777
RPC_X_SS_HANDLES_MISMATCH = 1778
RPC_X_SS_CANNOT_GET_CALL_HANDLE  = 1779
RPC_X_NULL_REF_POINTER = 1780
RPC_X_ENUM_VALUE_OUT_OF_RANGE = 1781
RPC_X_BYTE_COUNT_TOO_SMALL = 1782
RPC_X_BAD_STUB_DATA = 1783

ERROR_INVALID_USER_BUFFER = 1784
ERROR_UNRECOGNIZED_MEDIA = 1785
ERROR_NO_TRUST_LSA_SECRET = 1786
ERROR_NO_TRUST_SAM_ACCOUNT = 1787
ERROR_TRUSTED_DOMAIN_FAILURE  = 1788
ERROR_TRUSTED_RELATIONSHIP_FAILURE = 1789
ERROR_TRUST_FAILURE = 1790

RPC_S_CALL_IN_PROGRESS = 1791

ERROR_NETLOGON_NOT_STARTED = 1792
ERROR_ACCOUNT_EXPIRED = 1793
ERROR_REDIRECTOR_HAS_OPEN_HANDLES = 1794
ERROR_PRINTER_DRIVER_ALREADY_INSTALLED = 1795
ERROR_UNKNOWN_PORT = 1796
ERROR_UNKNOWN_PRINTER_DRIVER = 1797
ERROR_UNKNOWN_PRINTPROCESSOR = 1798
ERROR_INVALID_SEPARATOR_FILE = 1799
ERROR_INVALID_PRIORITY = 1800
ERROR_INVALID_PRINTER_NAME = 1801
ERROR_PRINTER_ALREADY_EXISTS = 1802
ERROR_INVALID_PRINTER_COMMAND = 1803
ERROR_INVALID_DATATYPE = 1804
ERROR_INVALID_ENVIRONMENT = 1805

RPC_S_NO_MORE_BINDINGS = 1806

ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT = 1807
ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT = 1808
ERROR_NOLOGON_SERVER_TRUST_ACCOUNT = 1809
ERROR_DOMAIN_TRUST_INCONSISTENT = 1810
ERROR_SERVER_HAS_OPEN_HANDLES = 1811
ERROR_RESOURCE_DATA_NOT_FOUND = 1812
ERROR_RESOURCE_TYPE_NOT_FOUND = 1813
ERROR_RESOURCE_NAME_NOT_FOUND = 1814
ERROR_RESOURCE_LANG_NOT_FOUND = 1815
ERROR_NOT_ENOUGH_QUOTA = 1816

RPC_S_NO_INTERFACES = 1817
RPC_S_CALL_CANCELLED = 1818
RPC_S_BINDING_INCOMPLETE = 1819
RPC_S_COMM_FAILURE = 1820
RPC_S_UNSUPPORTED_AUTHN_LEVEL = 1821
RPC_S_NO_PRINC_NAME = 1822
RPC_S_NOT_RPC_ERROR = 1823
RPC_S_UUID_LOCAL_ONLY = 1824
RPC_S_SEC_PKG_ERROR = 1825
RPC_S_NOT_CANCELLED = 1826
RPC_X_INVALID_ES_ACTION = 1827
RPC_X_WRONG_ES_VERSION = 1828
RPC_X_WRONG_STUB_VERSION = 1829
RPC_X_INVALID_PIPE_OBJECT = 1830
RPC_X_WRONG_PIPE_ORDER = 1831
RPC_X_WRONG_PIPE_VERSION = 1832
RPC_S_GROUP_MEMBER_NOT_FOUND = 1898

EPT_S_CANT_CREATE = 1899

RPC_S_INVALID_OBJECT = 1900

ERROR_INVALID_TIME = 1901
ERROR_INVALID_FORM_NAME = 1902
ERROR_INVALID_FORM_SIZE = 1903
ERROR_ALREADY_WAITING = 1904
ERROR_PRINTER_DELETED = 1905
ERROR_INVALID_PRINTER_STATE = 1906
ERROR_PASSWORD_MUST_CHANGE = 1907
ERROR_DOMAIN_CONTROLLER_NOT_FOUND = 1908
ERROR_ACCOUNT_LOCKED_OUT = 1909

OR_INVALID_OXID = 1910
OR_INVALID_OID = 1911
OR_INVALID_SET = 1912

RPC_S_SEND_INCOMPLETE = 1913
RPC_S_INVALID_ASYNC_HANDLE = 1914
RPC_S_INVALID_ASYNC_CALL = 1915
RPC_X_PIPE_CLOSED = 1916
RPC_X_PIPE_DISCIPLINE_ERROR  = 1917
RPC_X_PIPE_EMPTY = 1918

ERROR_NO_SITENAME = 1919
ERROR_CANT_ACCESS_FILE = 1920
ERROR_CANT_RESOLVE_FILENAME = 1921

RPC_S_ENTRY_TYPE_MISMATCH = 1922
RPC_S_NOT_ALL_OBJS_EXPORTED = 1923
RPC_S_INTERFACE_NOT_EXPORTED = 1924
RPC_S_PROFILE_NOT_ADDED = 1925
RPC_S_PRF_ELT_NOT_ADDED = 1926
RPC_S_PRF_ELT_NOT_REMOVED = 1927
RPC_S_GRP_ELT_NOT_ADDED = 1928
RPC_S_GRP_ELT_NOT_REMOVED = 1929

ERROR_KM_DRIVER_BLOCKED = 1930
ERROR_CONTEXT_EXPIRED = 1931
ERROR_PER_USER_TRUST_QUOTA_EXCEEDED = 1932
ERROR_ALL_USER_TRUST_QUOTA_EXCEEDED = 1933
ERROR_USER_DELETE_TRUST_QUOTA_EXCEEDED = 1934
ERROR_AUTHENTICATION_FIREWALL_FAILED = 1935
ERROR_REMOTE_PRINT_CONNECTIONS_BLOCKED = 1936
ERROR_INVALID_PIXEL_FORMAT = 2000
ERROR_BAD_DRIVER = 2001
ERROR_INVALID_WINDOW_STYLE = 2002
ERROR_METAFILE_NOT_SUPPORTED = 2003
ERROR_TRANSFORM_NOT_SUPPORTED = 2004
ERROR_CLIPPING_NOT_SUPPORTED = 2005
ERROR_INVALID_CMM = 2010
ERROR_INVALID_PROFILE = 2011
ERROR_TAG_NOT_FOUND = 2012
ERROR_TAG_NOT_PRESENT = 2013
ERROR_DUPLICATE_TAG = 2014
ERROR_PROFILE_NOT_ASSOCIATED_WITH_DEVICE = 2015
ERROR_PROFILE_NOT_FOUND = 2016
ERROR_INVALID_COLORSPACE = 2017
ERROR_ICM_NOT_ENABLED = 2018
ERROR_DELETING_ICM_XFORM = 2019
ERROR_INVALID_TRANSFORM = 2020
ERROR_COLORSPACE_MISMATCH = 2021
ERROR_INVALID_COLORINDEX = 2022
ERROR_CONNECTED_OTHER_PASSWORD = 2108
ERROR_CONNECTED_OTHER_PASSWORD_DEFAULT = 2109
ERROR_BAD_USERNAME = 2202
ERROR_NOT_CONNECTED = 2250
ERROR_OPEN_FILES = 2401
ERROR_ACTIVE_CONNECTIONS = 2402
ERROR_DEVICE_IN_USE = 2404
ERROR_UNKNOWN_PRINT_MONITOR = 3000
ERROR_PRINTER_DRIVER_IN_USE = 3001
ERROR_SPOOL_FILE_NOT_FOUND = 3002
ERROR_SPL_NO_STARTDOC = 3003
ERROR_SPL_NO_ADDJOB = 3004
ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED = 3005
ERROR_PRINT_MONITOR_ALREADY_INSTALLED = 3006
ERROR_INVALID_PRINT_MONITOR = 3007
ERROR_PRINT_MONITOR_IN_USE = 3008
ERROR_PRINTER_HAS_JOBS_QUEUED = 3009
ERROR_SUCCESS_REBOOT_REQUIRED = 3010
ERROR_SUCCESS_RESTART_REQUIRED = 3011
ERROR_PRINTER_NOT_FOUND = 3012
ERROR_PRINTER_DRIVER_WARNED = 3013
ERROR_PRINTER_DRIVER_BLOCKED = 3014
ERROR_WINS_INTERNAL = 4000
ERROR_CAN_NOT_DEL_LOCAL_WINS = 4001
ERROR_STATIC_INIT = 4002
ERROR_INC_BACKUP = 4003
ERROR_FULL_BACKUP = 4004
ERROR_REC_NON_EXISTENT = 4005
ERROR_RPL_NOT_ALLOWED = 4006
ERROR_DHCP_ADDRESS_CONFLICT = 4100
ERROR_WMI_GUID_NOT_FOUND = 4200
ERROR_WMI_INSTANCE_NOT_FOUND = 4201
ERROR_WMI_ITEMID_NOT_FOUND = 4202
ERROR_WMI_TRY_AGAIN = 4203
ERROR_WMI_DP_NOT_FOUND = 4204
ERROR_WMI_UNRESOLVED_INSTANCE_REF = 4205
ERROR_WMI_ALREADY_ENABLED = 4206
ERROR_WMI_GUID_DISCONNECTED = 4207
ERROR_WMI_SERVER_UNAVAILABLE = 4208
ERROR_WMI_DP_FAILED = 4209
ERROR_WMI_INVALID_MOF = 4210
ERROR_WMI_INVALID_REGINFO = 4211
ERROR_WMI_ALREADY_DISABLED = 4212
ERROR_WMI_READ_ONLY = 4213
ERROR_WMI_SET_FAILURE = 4214
ERROR_INVALID_MEDIA = 4300
ERROR_INVALID_LIBRARY = 4301
ERROR_INVALID_MEDIA_POOL = 4302
ERROR_DRIVE_MEDIA_MISMATCH = 4303
ERROR_MEDIA_OFFLINE = 4304
ERROR_LIBRARY_OFFLINE = 4305
ERROR_EMPTY = 4306
ERROR_NOT_EMPTY = 4307
ERROR_MEDIA_UNAVAILABLE = 4308
ERROR_RESOURCE_DISABLED = 4309
ERROR_INVALID_CLEANER = 4310
ERROR_UNABLE_TO_CLEAN = 4311
ERROR_OBJECT_NOT_FOUND = 4312
ERROR_DATABASE_FAILURE = 4313
ERROR_DATABASE_FULL = 4314
ERROR_MEDIA_INCOMPATIBLE = 4315
ERROR_RESOURCE_NOT_PRESENT = 4316
ERROR_INVALID_OPERATION = 4317
ERROR_MEDIA_NOT_AVAILABLE = 4318
ERROR_DEVICE_NOT_AVAILABLE = 4319
ERROR_REQUEST_REFUSED = 4320
ERROR_INVALID_DRIVE_OBJECT = 4321
ERROR_LIBRARY_FULL = 4322
ERROR_MEDIUM_NOT_ACCESSIBLE = 4323
ERROR_UNABLE_TO_LOAD_MEDIUM = 4324
ERROR_UNABLE_TO_INVENTORY_DRIVE = 4325
ERROR_UNABLE_TO_INVENTORY_SLOT = 4326
ERROR_UNABLE_TO_INVENTORY_TRANSPORT = 4327
ERROR_TRANSPORT_FULL = 4328
ERROR_CONTROLLING_IEPORT = 4329
ERROR_UNABLE_TO_EJECT_MOUNTED_MEDIA = 4330
ERROR_CLEANER_SLOT_SET = 4331
ERROR_CLEANER_SLOT_NOT_SET = 4332
ERROR_CLEANER_CARTRIDGE_SPENT = 4333
ERROR_UNEXPECTED_OMID = 4334
ERROR_CANT_DELETE_LAST_ITEM = 4335
ERROR_MESSAGE_EXCEEDS_MAX_SIZE = 4336
ERROR_VOLUME_CONTAINS_SYS_FILES = 4337
ERROR_INDIGENOUS_TYPE = 4338
ERROR_NO_SUPPORTING_DRIVES = 4339
ERROR_CLEANER_CARTRIDGE_INSTALLED = 4340
ERROR_IEPORT_FULL = 4341
ERROR_FILE_OFFLINE = 4350
ERROR_REMOTE_STORAGE_NOT_ACTIVE = 4351
ERROR_REMOTE_STORAGE_MEDIA_ERROR = 4352
ERROR_NOT_A_REPARSE_POINT = 4390
ERROR_REPARSE_ATTRIBUTE_CONFLICT = 4391
ERROR_INVALID_REPARSE_DATA = 4392
ERROR_REPARSE_TAG_INVALID = 4393
ERROR_REPARSE_TAG_MISMATCH = 4394
ERROR_VOLUME_NOT_SIS_ENABLED = 4500
ERROR_DEPENDENT_RESOURCE_EXISTS = 5001
ERROR_DEPENDENCY_NOT_FOUND = 5002
ERROR_DEPENDENCY_ALREADY_EXISTS = 5003
ERROR_RESOURCE_NOT_ONLINE = 5004
ERROR_HOST_NODE_NOT_AVAILABLE = 5005
ERROR_RESOURCE_NOT_AVAILABLE = 5006
ERROR_RESOURCE_NOT_FOUND = 5007
ERROR_SHUTDOWN_CLUSTER = 5008
ERROR_CANT_EVICT_ACTIVE_NODE = 5009
ERROR_OBJECT_ALREADY_EXISTS = 5010
ERROR_OBJECT_IN_LIST = 5011
ERROR_GROUP_NOT_AVAILABLE = 5012
ERROR_GROUP_NOT_FOUND = 5013
ERROR_GROUP_NOT_ONLINE = 5014
ERROR_HOST_NODE_NOT_RESOURCE_OWNER = 5015
ERROR_HOST_NODE_NOT_GROUP_OWNER  = 5016
ERROR_RESMON_CREATE_FAILED = 5017
ERROR_RESMON_ONLINE_FAILED = 5018
ERROR_RESOURCE_ONLINE = 5019
ERROR_QUORUM_RESOURCE = 5020
ERROR_NOT_QUORUM_CAPABLE = 5021
ERROR_CLUSTER_SHUTTING_DOWN = 5022
ERROR_INVALID_STATE = 5023
ERROR_RESOURCE_PROPERTIES_STORED = 5024
ERROR_NOT_QUORUM_CLASS = 5025
ERROR_CORE_RESOURCE = 5026
ERROR_QUORUM_RESOURCE_ONLINE_FAILED = 5027
ERROR_QUORUMLOG_OPEN_FAILED = 5028
ERROR_CLUSTERLOG_CORRUPT = 5029
ERROR_CLUSTERLOG_RECORD_EXCEEDS_MAXSIZE = 5030
ERROR_CLUSTERLOG_EXCEEDS_MAXSIZE = 5031
ERROR_CLUSTERLOG_CHKPOINT_NOT_FOUND = 5032
ERROR_CLUSTERLOG_NOT_ENOUGH_SPACE = 5033
ERROR_QUORUM_OWNER_ALIVE = 5034
ERROR_NETWORK_NOT_AVAILABLE = 5035
ERROR_NODE_NOT_AVAILABLE = 5036
ERROR_ALL_NODES_NOT_AVAILABLE = 5037
ERROR_RESOURCE_FAILED = 5038
ERROR_CLUSTER_INVALID_NODE = 5039
ERROR_CLUSTER_NODE_EXISTS = 5040
ERROR_CLUSTER_JOIN_IN_PROGRESS = 5041
ERROR_CLUSTER_NODE_NOT_FOUND = 5042
ERROR_CLUSTER_LOCAL_NODE_NOT_FOUND = 5043
ERROR_CLUSTER_NETWORK_EXISTS = 5044
ERROR_CLUSTER_NETWORK_NOT_FOUND = 5045
ERROR_CLUSTER_NETINTERFACE_EXISTS = 5046
ERROR_CLUSTER_NETINTERFACE_NOT_FOUND = 5047
ERROR_CLUSTER_INVALID_REQUEST = 5048
ERROR_CLUSTER_INVALID_NETWORK_PROVIDER = 5049
ERROR_CLUSTER_NODE_DOWN = 5050
ERROR_CLUSTER_NODE_UNREACHABLE = 5051
ERROR_CLUSTER_NODE_NOT_MEMBER = 5052
ERROR_CLUSTER_JOIN_NOT_IN_PROGRESS = 5053
ERROR_CLUSTER_INVALID_NETWORK = 5054
ERROR_CLUSTER_NODE_UP = 5056
ERROR_CLUSTER_IPADDR_IN_USE = 5057
ERROR_CLUSTER_NODE_NOT_PAUSED = 5058
ERROR_CLUSTER_NO_SECURITY_CONTEXT = 5059
ERROR_CLUSTER_NETWORK_NOT_INTERNAL = 5060
ERROR_CLUSTER_NODE_ALREADY_UP = 5061
ERROR_CLUSTER_NODE_ALREADY_DOWN = 5062
ERROR_CLUSTER_NETWORK_ALREADY_ONLINE = 5063
ERROR_CLUSTER_NETWORK_ALREADY_OFFLINE = 5064
ERROR_CLUSTER_NODE_ALREADY_MEMBER = 5065
ERROR_CLUSTER_LAST_INTERNAL_NETWORK = 5066
ERROR_CLUSTER_NETWORK_HAS_DEPENDENTS = 5067
ERROR_INVALID_OPERATION_ON_QUORUM = 5068
ERROR_DEPENDENCY_NOT_ALLOWED = 5069
ERROR_CLUSTER_NODE_PAUSED = 5070
ERROR_NODE_CANT_HOST_RESOURCE = 5071
ERROR_CLUSTER_NODE_NOT_READY = 5072
ERROR_CLUSTER_NODE_SHUTTING_DOWN = 5073
ERROR_CLUSTER_JOIN_ABORTED = 5074
ERROR_CLUSTER_INCOMPATIBLE_VERSIONS = 5075
ERROR_CLUSTER_MAXNUM_OF_RESOURCES_EXCEEDED = 5076
ERROR_CLUSTER_SYSTEM_CONFIG_CHANGED = 5077
ERROR_CLUSTER_RESOURCE_TYPE_NOT_FOUND = 5078
ERROR_CLUSTER_RESTYPE_NOT_SUPPORTED = 5079
ERROR_CLUSTER_RESNAME_NOT_FOUND = 5080
ERROR_CLUSTER_NO_RPC_PACKAGES_REGISTERED = 5081
ERROR_CLUSTER_OWNER_NOT_IN_PREFLIST = 5082
ERROR_CLUSTER_DATABASE_SEQMISMATCH = 5083
ERROR_RESMON_INVALID_STATE = 5084
ERROR_CLUSTER_GUM_NOT_LOCKER = 5085
ERROR_QUORUM_DISK_NOT_FOUND = 5086
ERROR_DATABASE_BACKUP_CORRUPT = 5087
ERROR_CLUSTER_NODE_ALREADY_HAS_DFS_ROOT = 5088
ERROR_RESOURCE_PROPERTY_UNCHANGEABLE = 5089
ERROR_CLUSTER_MEMBERSHIP_INVALID_STATE = 5890
ERROR_CLUSTER_QUORUMLOG_NOT_FOUND = 5891
ERROR_CLUSTER_MEMBERSHIP_HALT = 5892
ERROR_CLUSTER_INSTANCE_ID_MISMATCH = 5893
ERROR_CLUSTER_NETWORK_NOT_FOUND_FOR_IP = 5894
ERROR_CLUSTER_PROPERTY_DATA_TYPE_MISMATCH = 5895
ERROR_CLUSTER_EVICT_WITHOUT_CLEANUP = 5896
ERROR_CLUSTER_PARAMETER_MISMATCH = 5897
ERROR_NODE_CANNOT_BE_CLUSTERED = 5898
ERROR_CLUSTER_WRONG_OS_VERSION = 5899
ERROR_CLUSTER_CANT_CREATE_DUP_CLUSTER_NAME = 5900
ERROR_CLUSCFG_ALREADY_COMMITTED = 5901
ERROR_CLUSCFG_ROLLBACK_FAILED = 5902
ERROR_CLUSCFG_SYSTEM_DISK_DRIVE_LETTER_CONFLICT = 5903
ERROR_CLUSTER_OLD_VERSION = 5904
ERROR_CLUSTER_MISMATCHED_COMPUTER_ACCT_NAME = 5905
ERROR_ENCRYPTION_FAILED = 6000
ERROR_DECRYPTION_FAILED = 6001
ERROR_FILE_ENCRYPTED = 6002
ERROR_NO_RECOVERY_POLICY = 6003
ERROR_NO_EFS = 6004
ERROR_WRONG_EFS = 6005
ERROR_NO_USER_KEYS = 6006
ERROR_FILE_NOT_ENCRYPTED = 6007
ERROR_NOT_EXPORT_FORMAT = 6008
ERROR_FILE_READ_ONLY = 6009
ERROR_DIR_EFS_DISALLOWED = 6010
ERROR_EFS_SERVER_NOT_TRUSTED = 6011
ERROR_BAD_RECOVERY_POLICY = 6012
ERROR_EFS_ALG_BLOB_TOO_BIG = 6013
ERROR_VOLUME_NOT_SUPPORT_EFS = 6014
ERROR_EFS_DISABLED = 6015
ERROR_EFS_VERSION_NOT_SUPPORT = 6016
ERROR_NO_BROWSER_SERVERS_FOUND = 6118

SCHED_E_SERVICE_NOT_LOCALSYSTEM = 6200

ERROR_CTX_WINSTATION_NAME_INVALID = 7001
ERROR_CTX_INVALID_PD = 7002
ERROR_CTX_PD_NOT_FOUND = 7003
ERROR_CTX_WD_NOT_FOUND = 7004
ERROR_CTX_CANNOT_MAKE_EVENTLOG_ENTRY = 7005
ERROR_CTX_SERVICE_NAME_COLLISION = 7006
ERROR_CTX_CLOSE_PENDING = 7007
ERROR_CTX_NO_OUTBUF = 7008
ERROR_CTX_MODEM_INF_NOT_FOUND = 7009
ERROR_CTX_INVALID_MODEMNAME = 7010
ERROR_CTX_MODEM_RESPONSE_ERROR = 7011
ERROR_CTX_MODEM_RESPONSE_TIMEOUT = 7012
ERROR_CTX_MODEM_RESPONSE_NO_CARRIER = 7013
ERROR_CTX_MODEM_RESPONSE_NO_DIALTONE = 7014
ERROR_CTX_MODEM_RESPONSE_BUSY = 7015
ERROR_CTX_MODEM_RESPONSE_VOICE = 7016
ERROR_CTX_TD_ERROR = 7017
ERROR_CTX_WINSTATION_NOT_FOUND = 7022
ERROR_CTX_WINSTATION_ALREADY_EXISTS = 7023
ERROR_CTX_WINSTATION_BUSY = 7024
ERROR_CTX_BAD_VIDEO_MODE = 7025
ERROR_CTX_GRAPHICS_INVALID = 7035
ERROR_CTX_LOGON_DISABLED = 7037
ERROR_CTX_NOT_CONSOLE = 7038
ERROR_CTX_CLIENT_QUERY_TIMEOUT = 7040
ERROR_CTX_CONSOLE_DISCONNECT = 7041
ERROR_CTX_CONSOLE_CONNECT = 7042
ERROR_CTX_SHADOW_DENIED = 7044
ERROR_CTX_WINSTATION_ACCESS_DENIED = 7045
ERROR_CTX_INVALID_WD = 7049
ERROR_CTX_SHADOW_INVALID = 7050
ERROR_CTX_SHADOW_DISABLED = 7051
ERROR_CTX_CLIENT_LICENSE_IN_USE = 7052
ERROR_CTX_CLIENT_LICENSE_NOT_SET = 7053
ERROR_CTX_LICENSE_NOT_AVAILABLE = 7054
ERROR_CTX_LICENSE_CLIENT_INVALID = 7055
ERROR_CTX_LICENSE_EXPIRED = 7056
ERROR_CTX_SHADOW_NOT_RUNNING = 7057
ERROR_CTX_SHADOW_ENDED_BY_MODE_CHANGE = 7058
ERROR_ACTIVATION_COUNT_EXCEEDED = 7059

FRS_ERR_INVALID_API_SEQUENCE = 8001
FRS_ERR_STARTING_SERVICE = 8002
FRS_ERR_STOPPING_SERVICE = 8003
FRS_ERR_INTERNAL_API = 8004
FRS_ERR_INTERNAL = 8005
FRS_ERR_SERVICE_COMM = 8006
FRS_ERR_INSUFFICIENT_PRIV = 8007
FRS_ERR_AUTHENTICATION = 8008
FRS_ERR_PARENT_INSUFFICIENT_PRIV = 8009
FRS_ERR_PARENT_AUTHENTICATION = 8010
FRS_ERR_CHILD_TO_PARENT_COMM = 8011
FRS_ERR_PARENT_TO_CHILD_COMM = 8012
FRS_ERR_SYSVOL_POPULATE = 8013
FRS_ERR_SYSVOL_POPULATE_TIMEOUT  = 8014
FRS_ERR_SYSVOL_IS_BUSY = 8015
FRS_ERR_SYSVOL_DEMOTE = 8016
FRS_ERR_INVALID_SERVICE_PARAMETER = 8017

DS_S_SUCCESS = NO_ERROR

ERROR_DS_NOT_INSTALLED = 8200
ERROR_DS_MEMBERSHIP_EVALUATED_LOCALLY = 8201
ERROR_DS_NO_ATTRIBUTE_OR_VALUE = 8202
ERROR_DS_INVALID_ATTRIBUTE_SYNTAX = 8203
ERROR_DS_ATTRIBUTE_TYPE_UNDEFINED = 8204
ERROR_DS_ATTRIBUTE_OR_VALUE_EXISTS = 8205
ERROR_DS_BUSY = 8206
ERROR_DS_UNAVAILABLE = 8207
ERROR_DS_NO_RIDS_ALLOCATED = 8208
ERROR_DS_NO_MORE_RIDS = 8209
ERROR_DS_INCORRECT_ROLE_OWNER = 8210
ERROR_DS_RIDMGR_INIT_ERROR = 8211
ERROR_DS_OBJ_CLASS_VIOLATION = 8212
ERROR_DS_CANT_ON_NON_LEAF = 8213
ERROR_DS_CANT_ON_RDN = 8214
ERROR_DS_CANT_MOD_OBJ_CLASS = 8215
ERROR_DS_CROSS_DOM_MOVE_ERROR = 8216
ERROR_DS_GC_NOT_AVAILABLE = 8217
ERROR_SHARED_POLICY = 8218
ERROR_POLICY_OBJECT_NOT_FOUND = 8219
ERROR_POLICY_ONLY_IN_DS = 8220
ERROR_PROMOTION_ACTIVE = 8221
ERROR_NO_PROMOTION_ACTIVE = 8222
ERROR_DS_OPERATIONS_ERROR = 8224
ERROR_DS_PROTOCOL_ERROR = 8225
ERROR_DS_TIMELIMIT_EXCEEDED = 8226
ERROR_DS_SIZELIMIT_EXCEEDED = 8227
ERROR_DS_ADMIN_LIMIT_EXCEEDED = 8228
ERROR_DS_COMPARE_FALSE = 8229
ERROR_DS_COMPARE_TRUE = 8230
ERROR_DS_AUTH_METHOD_NOT_SUPPORTED = 8231
ERROR_DS_STRONG_AUTH_REQUIRED = 8232
ERROR_DS_INAPPROPRIATE_AUTH = 8233
ERROR_DS_AUTH_UNKNOWN = 8234
ERROR_DS_REFERRAL = 8235
ERROR_DS_UNAVAILABLE_CRIT_EXTENSION = 8236
ERROR_DS_CONFIDENTIALITY_REQUIRED = 8237
ERROR_DS_INAPPROPRIATE_MATCHING  = 8238
ERROR_DS_CONSTRAINT_VIOLATION = 8239
ERROR_DS_NO_SUCH_OBJECT = 8240
ERROR_DS_ALIAS_PROBLEM = 8241
ERROR_DS_INVALID_DN_SYNTAX = 8242
ERROR_DS_IS_LEAF = 8243
ERROR_DS_ALIAS_DEREF_PROBLEM = 8244
ERROR_DS_UNWILLING_TO_PERFORM = 8245
ERROR_DS_LOOP_DETECT = 8246
ERROR_DS_NAMING_VIOLATION = 8247
ERROR_DS_OBJECT_RESULTS_TOO_LARGE = 8248
ERROR_DS_AFFECTS_MULTIPLE_DSAS = 8249
ERROR_DS_SERVER_DOWN = 8250
ERROR_DS_LOCAL_ERROR = 8251
ERROR_DS_ENCODING_ERROR = 8252
ERROR_DS_DECODING_ERROR = 8253
ERROR_DS_FILTER_UNKNOWN = 8254
ERROR_DS_PARAM_ERROR = 8255
ERROR_DS_NOT_SUPPORTED = 8256
ERROR_DS_NO_RESULTS_RETURNED = 8257
ERROR_DS_CONTROL_NOT_FOUND = 8258
ERROR_DS_CLIENT_LOOP = 8259
ERROR_DS_REFERRAL_LIMIT_EXCEEDED = 8260
ERROR_DS_SORT_CONTROL_MISSING = 8261
ERROR_DS_OFFSET_RANGE_ERROR = 8262
ERROR_DS_ROOT_MUST_BE_NC = 8301
ERROR_DS_ADD_REPLICA_INHIBITED = 8302
ERROR_DS_ATT_NOT_DEF_IN_SCHEMA = 8303
ERROR_DS_MAX_OBJ_SIZE_EXCEEDED = 8304
ERROR_DS_OBJ_STRING_NAME_EXISTS = 8305
ERROR_DS_NO_RDN_DEFINED_IN_SCHEMA = 8306
ERROR_DS_RDN_DOESNT_MATCH_SCHEMA = 8307
ERROR_DS_NO_REQUESTED_ATTS_FOUND = 8308
ERROR_DS_USER_BUFFER_TO_SMALL = 8309
ERROR_DS_ATT_IS_NOT_ON_OBJ = 8310
ERROR_DS_ILLEGAL_MOD_OPERATION = 8311
ERROR_DS_OBJ_TOO_LARGE = 8312
ERROR_DS_BAD_INSTANCE_TYPE = 8313
ERROR_DS_MASTERDSA_REQUIRED = 8314
ERROR_DS_OBJECT_CLASS_REQUIRED = 8315
ERROR_DS_MISSING_REQUIRED_ATT = 8316
ERROR_DS_ATT_NOT_DEF_FOR_CLASS = 8317
ERROR_DS_ATT_ALREADY_EXISTS = 8318
ERROR_DS_CANT_ADD_ATT_VALUES = 8320
ERROR_DS_SINGLE_VALUE_CONSTRAINT = 8321
ERROR_DS_RANGE_CONSTRAINT = 8322
ERROR_DS_ATT_VAL_ALREADY_EXISTS = 8323
ERROR_DS_CANT_REM_MISSING_ATT = 8324
ERROR_DS_CANT_REM_MISSING_ATT_VAL = 8325
ERROR_DS_ROOT_CANT_BE_SUBREF = 8326
ERROR_DS_NO_CHAINING = 8327
ERROR_DS_NO_CHAINED_EVAL = 8328
ERROR_DS_NO_PARENT_OBJECT = 8329
ERROR_DS_PARENT_IS_AN_ALIAS = 8330
ERROR_DS_CANT_MIX_MASTER_AND_REPS = 8331
ERROR_DS_CHILDREN_EXIST = 8332
ERROR_DS_OBJ_NOT_FOUND = 8333
ERROR_DS_ALIASED_OBJ_MISSING = 8334
ERROR_DS_BAD_NAME_SYNTAX = 8335
ERROR_DS_ALIAS_POINTS_TO_ALIAS = 8336
ERROR_DS_CANT_DEREF_ALIAS = 8337
ERROR_DS_OUT_OF_SCOPE = 8338
ERROR_DS_OBJECT_BEING_REMOVED = 8339
ERROR_DS_CANT_DELETE_DSA_OBJ = 8340
ERROR_DS_GENERIC_ERROR = 8341
ERROR_DS_DSA_MUST_BE_INT_MASTER = 8342
ERROR_DS_CLASS_NOT_DSA = 8343
ERROR_DS_INSUFF_ACCESS_RIGHTS = 8344
ERROR_DS_ILLEGAL_SUPERIOR = 8345
ERROR_DS_ATTRIBUTE_OWNED_BY_SAM = 8346
ERROR_DS_NAME_TOO_MANY_PARTS = 8347
ERROR_DS_NAME_TOO_LONG = 8348
ERROR_DS_NAME_VALUE_TOO_LONG = 8349
ERROR_DS_NAME_UNPARSEABLE = 8350
ERROR_DS_NAME_TYPE_UNKNOWN = 8351
ERROR_DS_NOT_AN_OBJECT = 8352
ERROR_DS_SEC_DESC_TOO_SHORT = 8353
ERROR_DS_SEC_DESC_INVALID = 8354
ERROR_DS_NO_DELETED_NAME = 8355
ERROR_DS_SUBREF_MUST_HAVE_PARENT = 8356
ERROR_DS_NCNAME_MUST_BE_NC = 8357
ERROR_DS_CANT_ADD_SYSTEM_ONLY = 8358
ERROR_DS_CLASS_MUST_BE_CONCRETE = 8359
ERROR_DS_INVALID_DMD = 8360
ERROR_DS_OBJ_GUID_EXISTS = 8361
ERROR_DS_NOT_ON_BACKLINK = 8362
ERROR_DS_NO_CROSSREF_FOR_NC = 8363
ERROR_DS_SHUTTING_DOWN = 8364
ERROR_DS_UNKNOWN_OPERATION = 8365
ERROR_DS_INVALID_ROLE_OWNER = 8366
ERROR_DS_COULDNT_CONTACT_FSMO = 8367
ERROR_DS_CROSS_NC_DN_RENAME = 8368
ERROR_DS_CANT_MOD_SYSTEM_ONLY = 8369
ERROR_DS_REPLICATOR_ONLY = 8370
ERROR_DS_OBJ_CLASS_NOT_DEFINED = 8371
ERROR_DS_OBJ_CLASS_NOT_SUBCLASS = 8372
ERROR_DS_NAME_REFERENCE_INVALID = 8373
ERROR_DS_CROSS_REF_EXISTS = 8374
ERROR_DS_CANT_DEL_MASTER_CROSSREF = 8375
ERROR_DS_SUBTREE_NOTIFY_NOT_NC_HEAD = 8376
ERROR_DS_NOTIFY_FILTER_TOO_COMPLEX = 8377
ERROR_DS_DUP_RDN = 8378
ERROR_DS_DUP_OID = 8379
ERROR_DS_DUP_MAPI_ID = 8380
ERROR_DS_DUP_SCHEMA_ID_GUID = 8381
ERROR_DS_DUP_LDAP_DISPLAY_NAME = 8382
ERROR_DS_SEMANTIC_ATT_TEST = 8383
ERROR_DS_SYNTAX_MISMATCH = 8384
ERROR_DS_EXISTS_IN_MUST_HAVE = 8385
ERROR_DS_EXISTS_IN_MAY_HAVE = 8386
ERROR_DS_NONEXISTENT_MAY_HAVE = 8387
ERROR_DS_NONEXISTENT_MUST_HAVE = 8388
ERROR_DS_AUX_CLS_TEST_FAIL = 8389
ERROR_DS_NONEXISTENT_POSS_SUP = 8390
ERROR_DS_SUB_CLS_TEST_FAIL = 8391
ERROR_DS_BAD_RDN_ATT_ID_SYNTAX = 8392
ERROR_DS_EXISTS_IN_AUX_CLS = 8393
ERROR_DS_EXISTS_IN_SUB_CLS = 8394
ERROR_DS_EXISTS_IN_POSS_SUP = 8395
ERROR_DS_RECALCSCHEMA_FAILED = 8396
ERROR_DS_TREE_DELETE_NOT_FINISHED = 8397
ERROR_DS_CANT_DELETE = 8398
ERROR_DS_ATT_SCHEMA_REQ_ID = 8399
ERROR_DS_BAD_ATT_SCHEMA_SYNTAX = 8400
ERROR_DS_CANT_CACHE_ATT = 8401
ERROR_DS_CANT_CACHE_CLASS = 8402
ERROR_DS_CANT_REMOVE_ATT_CACHE = 8403
ERROR_DS_CANT_REMOVE_CLASS_CACHE = 8404
ERROR_DS_CANT_RETRIEVE_DN = 8405
ERROR_DS_MISSING_SUPREF = 8406
ERROR_DS_CANT_RETRIEVE_INSTANCE = 8407
ERROR_DS_CODE_INCONSISTENCY = 8408
ERROR_DS_DATABASE_ERROR = 8409
ERROR_DS_GOVERNSID_MISSING = 8410
ERROR_DS_MISSING_EXPECTED_ATT = 8411
ERROR_DS_NCNAME_MISSING_CR_REF = 8412
ERROR_DS_SECURITY_CHECKING_ERROR = 8413
ERROR_DS_SCHEMA_NOT_LOADED = 8414
ERROR_DS_SCHEMA_ALLOC_FAILED = 8415
ERROR_DS_ATT_SCHEMA_REQ_SYNTAX = 8416
ERROR_DS_GCVERIFY_ERROR = 8417
ERROR_DS_DRA_SCHEMA_MISMATCH = 8418
ERROR_DS_CANT_FIND_DSA_OBJ = 8419
ERROR_DS_CANT_FIND_EXPECTED_NC = 8420
ERROR_DS_CANT_FIND_NC_IN_CACHE = 8421
ERROR_DS_CANT_RETRIEVE_CHILD = 8422
ERROR_DS_SECURITY_ILLEGAL_MODIFY = 8423
ERROR_DS_CANT_REPLACE_HIDDEN_REC = 8424
ERROR_DS_BAD_HIERARCHY_FILE = 8425
ERROR_DS_BUILD_HIERARCHY_TABLE_FAILED = 8426
ERROR_DS_CONFIG_PARAM_MISSING = 8427
ERROR_DS_COUNTING_AB_INDICES_FAILED = 8428
ERROR_DS_HIERARCHY_TABLE_MALLOC_FAILED = 8429
ERROR_DS_INTERNAL_FAILURE = 8430
ERROR_DS_UNKNOWN_ERROR = 8431
ERROR_DS_ROOT_REQUIRES_CLASS_TOP = 8432
ERROR_DS_REFUSING_FSMO_ROLES = 8433
ERROR_DS_MISSING_FSMO_SETTINGS = 8434
ERROR_DS_UNABLE_TO_SURRENDER_ROLES = 8435
ERROR_DS_DRA_GENERIC = 8436
ERROR_DS_DRA_INVALID_PARAMETER = 8437
ERROR_DS_DRA_BUSY = 8438
ERROR_DS_DRA_BAD_DN = 8439
ERROR_DS_DRA_BAD_NC = 8440
ERROR_DS_DRA_DN_EXISTS = 8441
ERROR_DS_DRA_INTERNAL_ERROR = 8442
ERROR_DS_DRA_INCONSISTENT_DIT = 8443
ERROR_DS_DRA_CONNECTION_FAILED = 8444
ERROR_DS_DRA_BAD_INSTANCE_TYPE = 8445
ERROR_DS_DRA_OUT_OF_MEM = 8446
ERROR_DS_DRA_MAIL_PROBLEM = 8447
ERROR_DS_DRA_REF_ALREADY_EXISTS = 8448
ERROR_DS_DRA_REF_NOT_FOUND = 8449
ERROR_DS_DRA_OBJ_IS_REP_SOURCE = 8450
ERROR_DS_DRA_DB_ERROR = 8451
ERROR_DS_DRA_NO_REPLICA = 8452
ERROR_DS_DRA_ACCESS_DENIED = 8453
ERROR_DS_DRA_NOT_SUPPORTED = 8454
ERROR_DS_DRA_RPC_CANCELLED = 8455
ERROR_DS_DRA_SOURCE_DISABLED = 8456
ERROR_DS_DRA_SINK_DISABLED = 8457
ERROR_DS_DRA_NAME_COLLISION = 8458
ERROR_DS_DRA_SOURCE_REINSTALLED = 8459
ERROR_DS_DRA_MISSING_PARENT = 8460
ERROR_DS_DRA_PREEMPTED = 8461
ERROR_DS_DRA_ABANDON_SYNC = 8462
ERROR_DS_DRA_SHUTDOWN = 8463
ERROR_DS_DRA_INCOMPATIBLE_PARTIAL_SET = 8464
ERROR_DS_DRA_SOURCE_IS_PARTIAL_REPLICA = 8465
ERROR_DS_DRA_EXTN_CONNECTION_FAILED = 8466
ERROR_DS_INSTALL_SCHEMA_MISMATCH = 8467
ERROR_DS_DUP_LINK_ID = 8468
ERROR_DS_NAME_ERROR_RESOLVING = 8469
ERROR_DS_NAME_ERROR_NOT_FOUND = 8470
ERROR_DS_NAME_ERROR_NOT_UNIQUE = 8471
ERROR_DS_NAME_ERROR_NO_MAPPING = 8472
ERROR_DS_NAME_ERROR_DOMAIN_ONLY = 8473
ERROR_DS_NAME_ERROR_NO_SYNTACTICAL_MAPPING = 8474
ERROR_DS_CONSTRUCTED_ATT_MOD = 8475
ERROR_DS_WRONG_OM_OBJ_CLASS = 8476
ERROR_DS_DRA_REPL_PENDING = 8477
ERROR_DS_DS_REQUIRED = 8478
ERROR_DS_INVALID_LDAP_DISPLAY_NAME = 8479
ERROR_DS_NON_BASE_SEARCH = 8480
ERROR_DS_CANT_RETRIEVE_ATTS = 8481
ERROR_DS_BACKLINK_WITHOUT_LINK = 8482
ERROR_DS_EPOCH_MISMATCH = 8483
ERROR_DS_SRC_NAME_MISMATCH = 8484
ERROR_DS_SRC_AND_DST_NC_IDENTICAL = 8485
ERROR_DS_DST_NC_MISMATCH = 8486
ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC = 8487
ERROR_DS_SRC_GUID_MISMATCH = 8488
ERROR_DS_CANT_MOVE_DELETED_OBJECT = 8489
ERROR_DS_PDC_OPERATION_IN_PROGRESS = 8490
ERROR_DS_CROSS_DOMAIN_CLEANUP_REQD = 8491
ERROR_DS_ILLEGAL_XDOM_MOVE_OPERATION = 8492
ERROR_DS_CANT_WITH_ACCT_GROUP_MEMBERSHPS = 8493
ERROR_DS_NC_MUST_HAVE_NC_PARENT = 8494
ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE = 8495
ERROR_DS_DST_DOMAIN_NOT_NATIVE = 8496
ERROR_DS_MISSING_INFRASTRUCTURE_CONTAINER = 8497
ERROR_DS_CANT_MOVE_ACCOUNT_GROUP = 8498
ERROR_DS_CANT_MOVE_RESOURCE_GROUP = 8499
ERROR_DS_INVALID_SEARCH_FLAG = 8500
ERROR_DS_NO_TREE_DELETE_ABOVE_NC = 8501
ERROR_DS_COULDNT_LOCK_TREE_FOR_DELETE = 8502
ERROR_DS_COULDNT_IDENTIFY_OBJECTS_FOR_TREE_DELETE = 8503
ERROR_DS_SAM_INIT_FAILURE = 8504
ERROR_DS_SENSITIVE_GROUP_VIOLATION = 8505
ERROR_DS_CANT_MOD_PRIMARYGROUPID = 8506
ERROR_DS_ILLEGAL_BASE_SCHEMA_MOD = 8507
ERROR_DS_NONSAFE_SCHEMA_CHANGE = 8508
ERROR_DS_SCHEMA_UPDATE_DISALLOWED = 8509
ERROR_DS_CANT_CREATE_UNDER_SCHEMA = 510
ERROR_DS_INSTALL_NO_SRC_SCH_VERSION = 8511
ERROR_DS_INSTALL_NO_SCH_VERSION_IN_INIFILE = 8512
ERROR_DS_INVALID_GROUP_TYPE = 8513
ERROR_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN = 8514
ERROR_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN = 8515
ERROR_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER = 8516
ERROR_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER = 8517
ERROR_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER = 8518
ERROR_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER = 8519
ERROR_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER = 8520
ERROR_DS_HAVE_PRIMARY_MEMBERS = 8521
ERROR_DS_STRING_SD_CONVERSION_FAILED = 8522
ERROR_DS_NAMING_MASTER_GC = 8523
ERROR_DS_DNS_LOOKUP_FAILURE = 8524
ERROR_DS_COULDNT_UPDATE_SPNS = 8525
ERROR_DS_CANT_RETRIEVE_SD = 8526
ERROR_DS_KEY_NOT_UNIQUE = 8527
ERROR_DS_WRONG_LINKED_ATT_SYNTAX = 8528
ERROR_DS_SAM_NEED_BOOTKEY_PASSWORD = 8529
ERROR_DS_SAM_NEED_BOOTKEY_FLOPPY = 8530
ERROR_DS_CANT_START = 8531
ERROR_DS_INIT_FAILURE = 8532
ERROR_DS_NO_PKT_PRIVACY_ON_CONNECTION = 8533
ERROR_DS_SOURCE_DOMAIN_IN_FOREST = 8534
ERROR_DS_DESTINATION_DOMAIN_NOT_IN_FOREST = 8535
ERROR_DS_DESTINATION_AUDITING_NOT_ENABLED = 8536
ERROR_DS_CANT_FIND_DC_FOR_SRC_DOMAIN = 8537
ERROR_DS_SRC_OBJ_NOT_GROUP_OR_USER = 8538
ERROR_DS_SRC_SID_EXISTS_IN_FOREST = 8539
ERROR_DS_SRC_AND_DST_OBJECT_CLASS_MISMATCH = 8540
ERROR_SAM_INIT_FAILURE = 8541
ERROR_DS_DRA_SCHEMA_INFO_SHIP = 8542
ERROR_DS_DRA_SCHEMA_CONFLICT = 8543
ERROR_DS_DRA_EARLIER_SCHEMA_CONFLICT = 8544
ERROR_DS_DRA_OBJ_NC_MISMATCH = 8545
ERROR_DS_NC_STILL_HAS_DSAS = 8546
ERROR_DS_GC_REQUIRED = 8547
ERROR_DS_LOCAL_MEMBER_OF_LOCAL_ONLY = 8548
ERROR_DS_NO_FPO_IN_UNIVERSAL_GROUPS = 8549
ERROR_DS_CANT_ADD_TO_GC = 8550
ERROR_DS_NO_CHECKPOINT_WITH_PDC = 8551
ERROR_DS_SOURCE_AUDITING_NOT_ENABLED = 8552
ERROR_DS_CANT_CREATE_IN_NONDOMAIN_NC = 8553
ERROR_DS_INVALID_NAME_FOR_SPN = 8554
ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS = 8555
ERROR_DS_UNICODEPWD_NOT_IN_QUOTES = 8556
ERROR_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED = 8557
ERROR_DS_MUST_BE_RUN_ON_DST_DC = 8558
ERROR_DS_SRC_DC_MUST_BE_SP4_OR_GREATER = 8559
ERROR_DS_CANT_TREE_DELETE_CRITICAL_OBJ = 8560
ERROR_DS_INIT_FAILURE_CONSOLE = 8561
ERROR_DS_SAM_INIT_FAILURE_CONSOLE = 8562
ERROR_DS_FOREST_VERSION_TOO_HIGH = 8563
ERROR_DS_DOMAIN_VERSION_TOO_HIGH = 8564
ERROR_DS_FOREST_VERSION_TOO_LOW = 8565
ERROR_DS_DOMAIN_VERSION_TOO_LOW = 8566
ERROR_DS_INCOMPATIBLE_VERSION = 8567
ERROR_DS_LOW_DSA_VERSION = 8568
ERROR_DS_NO_BEHAVIOR_VERSION_IN_MIXEDDOMAIN = 8569
ERROR_DS_NOT_SUPPORTED_SORT_ORDER = 8570
ERROR_DS_NAME_NOT_UNIQUE = 8571
ERROR_DS_MACHINE_ACCOUNT_CREATED_PRENT4 = 8572
ERROR_DS_OUT_OF_VERSION_STORE = 8573
ERROR_DS_INCOMPATIBLE_CONTROLS_USED = 8574
ERROR_DS_NO_REF_DOMAIN = 8575
ERROR_DS_RESERVED_LINK_ID = 8576
ERROR_DS_LINK_ID_NOT_AVAILABLE = 8577
ERROR_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER = 8578
ERROR_DS_MODIFYDN_DISALLOWED_BY_INSTANCE_TYPE = 8579
ERROR_DS_NO_OBJECT_MOVE_IN_SCHEMA_NC = 8580
ERROR_DS_MODIFYDN_DISALLOWED_BY_FLAG = 8581
ERROR_DS_MODIFYDN_WRONG_GRANDPARENT = 8582
ERROR_DS_NAME_ERROR_TRUST_REFERRAL = 8583
ERROR_NOT_SUPPORTED_ON_STANDARD_SERVER = 8584
ERROR_DS_CANT_ACCESS_REMOTE_PART_OF_AD = 8585
ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE_V2 = 8586
ERROR_DS_THREAD_LIMIT_EXCEEDED = 8587
ERROR_DS_NOT_CLOSEST = 8588
ERROR_DS_CANT_DERIVE_SPN_WITHOUT_SERVER_REF = 8589
ERROR_DS_SINGLE_USER_MODE_FAILED = 8590
ERROR_DS_NTDSCRIPT_SYNTAX_ERROR = 8591
ERROR_DS_NTDSCRIPT_PROCESS_ERROR = 8592
ERROR_DS_DIFFERENT_REPL_EPOCHS = 8593
ERROR_DS_DRS_EXTENSIONS_CHANGED = 8594
ERROR_DS_REPLICA_SET_CHANGE_NOT_ALLOWED_ON_DISABLED_CR = 8595
ERROR_DS_NO_MSDS_INTID = 8596
ERROR_DS_DUP_MSDS_INTID = 8597
ERROR_DS_EXISTS_IN_RDNATTID = 8598
ERROR_DS_AUTHORIZATION_FAILED = 8599
ERROR_DS_INVALID_SCRIPT = 8600
ERROR_DS_REMOTE_CROSSREF_OP_FAILED = 8601
ERROR_DS_CROSS_REF_BUSY = 8602
ERROR_DS_CANT_DERIVE_SPN_FOR_DELETED_DOMAIN = 8603
ERROR_DS_CANT_DEMOTE_WITH_WRITEABLE_NC = 8604
ERROR_DS_DUPLICATE_ID_FOUND = 8605
ERROR_DS_INSUFFICIENT_ATTR_TO_CREATE_OBJECT = 8606
ERROR_DS_GROUP_CONVERSION_ERROR = 8607
ERROR_DS_CANT_MOVE_APP_BASIC_GROUP = 8608
ERROR_DS_CANT_MOVE_APP_QUERY_GROUP = 8609
ERROR_DS_ROLE_NOT_VERIFIED = 8610
ERROR_DS_WKO_CONTAINER_CANNOT_BE_SPECIAL = 8611
ERROR_DS_DOMAIN_RENAME_IN_PROGRESS = 8612
ERROR_DS_EXISTING_AD_CHILD_NC = 8613
ERROR_DS_REPL_LIFETIME_EXCEEDED = 8614
ERROR_DS_DISALLOWED_IN_SYSTEM_CONTAINER = 8615
ERROR_DS_LDAP_SEND_QUEUE_FULL = 8616
ERROR_DS_DRA_OUT_SCHEDULE_WINDOW = 8617

DNS_ERROR_RESPONSE_CODES_BASE = 9000
DNS_ERROR_RCODE_NO_ERROR = NO_ERROR
DNS_ERROR_MASK = $2328
DNS_ERROR_RCODE_FORMAT_ERROR = 9001
DNS_ERROR_RCODE_SERVER_FAILURE = 9002
DNS_ERROR_RCODE_NAME_ERROR = 9003
DNS_ERROR_RCODE_NOT_IMPLEMENTED = 9004
DNS_ERROR_RCODE_REFUSED = 9005
DNS_ERROR_RCODE_YXDOMAIN = 9006
DNS_ERROR_RCODE_YXRRSET = 9007
DNS_ERROR_RCODE_NXRRSET = 9008
DNS_ERROR_RCODE_NOTAUTH = 9009
DNS_ERROR_RCODE_NOTZONE = 9010
DNS_ERROR_RCODE_BADSIG = 9016
DNS_ERROR_RCODE_BADKEY = 9017
DNS_ERROR_RCODE_BADTIME = 9018
DNS_ERROR_RCODE_LAST = DNS_ERROR_RCODE_BADTIME
DNS_ERROR_PACKET_FMT_BASE = 9500
DNS_INFO_NO_RECORDS = 9501
DNS_ERROR_BAD_PACKET = 9502
DNS_ERROR_NO_PACKET = 9503
DNS_ERROR_RCODE = 9504
DNS_ERROR_UNSECURE_PACKET = 9505
DNS_STATUS_PACKET_UNSECURE = DNS_ERROR_UNSECURE_PACKET
DNS_ERROR_NO_MEMORY = ERROR_OUTOFMEMORY
DNS_ERROR_INVALID_NAME = ERROR_INVALID_NAME
DNS_ERROR_INVALID_DATA = ERROR_INVALID_DATA
DNS_ERROR_GENERAL_API_BASE = 9550
DNS_ERROR_INVALID_TYPE = 9551
DNS_ERROR_INVALID_IP_ADDRESS = 9552
DNS_ERROR_INVALID_PROPERTY  = 9553
DNS_ERROR_TRY_AGAIN_LATER = 9554
DNS_ERROR_NOT_UNIQUE = 9555
DNS_ERROR_NON_RFC_NAME = 9556
DNS_STATUS_FQDN = 9557
DNS_STATUS_DOTTED_NAME = 9558
DNS_STATUS_SINGLE_PART_NAME = 9559
DNS_ERROR_INVALID_NAME_CHAR = 9560
DNS_ERROR_NUMERIC_NAME = 9561
DNS_ERROR_NOT_ALLOWED_ON_ROOT_SERVER = 9562
DNS_ERROR_NOT_ALLOWED_UNDER_DELEGATION = 9563
DNS_ERROR_CANNOT_FIND_ROOT_HINTS = 9564
DNS_ERROR_INCONSISTENT_ROOT_HINTS = 9565
DNS_ERROR_ZONE_BASE = 9600
DNS_ERROR_ZONE_DOES_NOT_EXIST = 9601
DNS_ERROR_NO_ZONE_INFO = 9602
DNS_ERROR_INVALID_ZONE_OPERATION = 9603
DNS_ERROR_ZONE_CONFIGURATION_ERROR = 9604
DNS_ERROR_ZONE_HAS_NO_SOA_RECORD = 9605
DNS_ERROR_ZONE_HAS_NO_NS_RECORDS = 9606
DNS_ERROR_ZONE_LOCKED = 9607
DNS_ERROR_ZONE_CREATION_FAILED = 9608
DNS_ERROR_ZONE_ALREADY_EXISTS = 9609
DNS_ERROR_AUTOZONE_ALREADY_EXISTS = 9610
DNS_ERROR_INVALID_ZONE_TYPE = 9611
DNS_ERROR_SECONDARY_REQUIRES_MASTER_IP = 9612
DNS_ERROR_ZONE_NOT_SECONDARY = 9613
DNS_ERROR_NEED_SECONDARY_ADDRESSES = 9614
DNS_ERROR_WINS_INIT_FAILED = 9615
DNS_ERROR_NEED_WINS_SERVERS = 9616
DNS_ERROR_NBSTAT_INIT_FAILED = 9617
DNS_ERROR_SOA_DELETE_INVALID = 9618
DNS_ERROR_FORWARDER_ALREADY_EXISTS = 9619
DNS_ERROR_ZONE_REQUIRES_MASTER_IP = 9620
DNS_ERROR_ZONE_IS_SHUTDOWN = 9621
DNS_ERROR_DATAFILE_BASE = 9650
DNS_ERROR_PRIMARY_REQUIRES_DATAFILE = 9651
DNS_ERROR_INVALID_DATAFILE_NAME = 9652
DNS_ERROR_DATAFILE_OPEN_FAILURE = 9653
DNS_ERROR_FILE_WRITEBACK_FAILED = 9654
DNS_ERROR_DATAFILE_PARSING = 9655
DNS_ERROR_DATABASE_BASE = 9700
DNS_ERROR_RECORD_DOES_NOT_EXIST = 9701
DNS_ERROR_RECORD_FORMAT = 9702
DNS_ERROR_NODE_CREATION_FAILED = 9703
DNS_ERROR_UNKNOWN_RECORD_TYPE  = 9704
DNS_ERROR_RECORD_TIMED_OUT = 9705
DNS_ERROR_NAME_NOT_IN_ZONE = 9706
DNS_ERROR_CNAME_LOOP = 9707
DNS_ERROR_NODE_IS_CNAME = 9708
DNS_ERROR_CNAME_COLLISION = 9709
DNS_ERROR_RECORD_ONLY_AT_ZONE_ROOT = 9710
DNS_ERROR_RECORD_ALREADY_EXISTS = 9711
DNS_ERROR_SECONDARY_DATA = 9712
DNS_ERROR_NO_CREATE_CACHE_DATA = 9713
DNS_ERROR_NAME_DOES_NOT_EXIST = 9714
DNS_WARNING_PTR_CREATE_FAILED = 9715
DNS_WARNING_DOMAIN_UNDELETED = 9716
DNS_ERROR_DS_UNAVAILABLE = 9717
DNS_ERROR_DS_ZONE_ALREADY_EXISTS = 9718
DNS_ERROR_NO_BOOTFILE_IF_DS_ZONE = 9719
DNS_ERROR_OPERATION_BASE = 9750
DNS_INFO_AXFR_COMPLETE = 9751
DNS_ERROR_AXFR = 9752
DNS_INFO_ADDED_LOCAL_WINS = 9753
DNS_ERROR_SECURE_BASE = 9800
DNS_STATUS_CONTINUE_NEEDED = 9801
DNS_ERROR_SETUP_BASE = 9850
DNS_ERROR_NO_TCPIP = 9851
DNS_ERROR_NO_DNS_SERVERS = 9852
DNS_ERROR_DP_BASE = 9900
DNS_ERROR_DP_DOES_NOT_EXIST = 9901
DNS_ERROR_DP_ALREADY_EXISTS = 9902
DNS_ERROR_DP_NOT_ENLISTED = 9903
DNS_ERROR_DP_ALREADY_ENLISTED = 9904
DNS_ERROR_DP_NOT_AVAILABLE = 9905
DNS_ERROR_DP_FSMO_ERROR = 9906

WSABASEERR = 10000
WSAEINTR = 10004
WSAEBADF = 10009
WSAEACCES = 10013
WSAEFAULT = 10014
WSAEINVAL = 10022
WSAEMFILE = 10024
WSAEWOULDBLOCK = 10035
WSAEINPROGRESS = 10036
WSAEALREADY = 10037
WSAENOTSOCK = 10038
WSAEDESTADDRREQ = 10039
WSAEMSGSIZE = 10040
WSAEPROTOTYPE = 10041
WSAENOPROTOOPT = 10042
WSAEPROTONOSUPPORT  = 10043
WSAESOCKTNOSUPPORT  = 10044
WSAEOPNOTSUPP = 10045
WSAEPFNOSUPPORT = 10046
WSAEAFNOSUPPORT = 10047
WSAEADDRINUSE = 10048
WSAEADDRNOTAVAIL = 10049
WSAENETDOWN = 10050
WSAENETUNREACH = 10051
WSAENETRESET = 10052
WSAECONNABORTED = 10053
WSAECONNRESET = 10054
WSAENOBUFS = 10055
WSAEISCONN = 10056
WSAENOTCONN = 10057
WSAESHUTDOWN = 10058
WSAETOOMANYREFS = 10059
WSAETIMEDOUT = 10060
WSAECONNREFUSED = 10061
WSAELOOP = 10062
WSAENAMETOOLONG = 10063
WSAEHOSTDOWN = 10064
WSAEHOSTUNREACH = 10065
WSAENOTEMPTY = 10066
WSAEPROCLIM = 10067
WSAEUSERS = 10068
WSAEDQUOT = 10069
WSAESTALE = 10070
WSAEREMOTE = 10071
WSASYSNOTREADY	= 10091
WSAVERNOTSUPPORTED = 10092
WSANOTINITIALISED = 10093
WSAEDISCON = 10101
WSAENOMORE = 10102
WSAECANCELLED = 10103
WSAEINVALIDPROCTABLE = 10104
WSAEINVALIDPROVIDER = 10105
WSAEPROVIDERFAILEDINIT = 10106
WSASYSCALLFAILURE = 10107
WSASERVICE_NOT_FOUND = 10108
WSATYPE_NOT_FOUND = 10109
WSA_E_NO_MORE = 10110
WSA_E_CANCELLED = 10111
WSAEREFUSED = 10112
WSAHOST_NOT_FOUND = 11001
WSATRY_AGAIN = 11002
WSANO_RECOVERY = 11003
WSANO_DATA = 11004
WSA_QOS_RECEIVERS = 11005
WSA_QOS_SENDERS = 11006
WSA_QOS_NO_SENDERS = 11007
WSA_QOS_NO_RECEIVERS = 11008
WSA_QOS_REQUEST_CONFIRMED = 11009
WSA_QOS_ADMISSION_FAILURE = 11010
WSA_QOS_POLICY_FAILURE = 11011
WSA_QOS_BAD_STYLE = 11012
WSA_QOS_BAD_OBJECT = 11013
WSA_QOS_TRAFFIC_CTRL_ERROR = 11014
WSA_QOS_GENERIC_ERROR = 11015
WSA_QOS_ESERVICETYPE = 11016
WSA_QOS_EFLOWSPEC = 11017
WSA_QOS_EPROVSPECBUF = 11018
WSA_QOS_EFILTERSTYLE = 11019
WSA_QOS_EFILTERTYPE = 11020
WSA_QOS_EFILTERCOUNT = 11021
WSA_QOS_EOBJLENGTH = 11022
WSA_QOS_EFLOWCOUNT = 11023
WSA_QOS_EUNKOWNPSOBJ = 11024
WSA_QOS_EPOLICYOBJ = 11025
WSA_QOS_EFLOWDESC = 11026
WSA_QOS_EPSFLOWSPEC = 11027
WSA_QOS_EPSFILTERSPEC = 11028
WSA_QOS_ESDMODEOBJ = 11029
WSA_QOS_ESHAPERATEOBJ = 11030
WSA_QOS_RESERVED_PETYPE = 11031

ERROR_SXS_SECTION_NOT_FOUND = 14000
ERROR_SXS_CANT_GEN_ACTCTX = 14001
ERROR_SXS_INVALID_ACTCTXDATA_FORMAT = 14002
ERROR_SXS_ASSEMBLY_NOT_FOUND = 14003
ERROR_SXS_MANIFEST_FORMAT_ERROR = 14004
ERROR_SXS_MANIFEST_PARSE_ERROR = 14005
ERROR_SXS_ACTIVATION_CONTEXT_DISABLED = 14006
ERROR_SXS_KEY_NOT_FOUND = 14007
ERROR_SXS_VERSION_CONFLICT = 14008
ERROR_SXS_WRONG_SECTION_TYPE = 14009
ERROR_SXS_THREAD_QUERIES_DISABLED = 14010
ERROR_SXS_PROCESS_DEFAULT_ALREADY_SET = 14011
ERROR_SXS_UNKNOWN_ENCODING_GROUP = 14012
ERROR_SXS_UNKNOWN_ENCODING = 14013
ERROR_SXS_INVALID_XML_NAMESPACE_URI = 14014
ERROR_SXS_ROOT_MANIFEST_DEPENDENCY_NOT_INSTALLED = 14015
ERROR_SXS_LEAF_MANIFEST_DEPENDENCY_NOT_INSTALLED = 14016
ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE = 14017
ERROR_SXS_MANIFEST_MISSING_REQUIRED_DEFAULT_NAMESPACE = 14018
ERROR_SXS_MANIFEST_INVALID_REQUIRED_DEFAULT_NAMESPACE = 14019
ERROR_SXS_PRIVATE_MANIFEST_CROSS_PATH_WITH_REPARSE_POINT = 14020
ERROR_SXS_DUPLICATE_DLL_NAME = 14021
ERROR_SXS_DUPLICATE_WINDOWCLASS_NAME = 14022
ERROR_SXS_DUPLICATE_CLSID = 14023
ERROR_SXS_DUPLICATE_IID = 14024
ERROR_SXS_DUPLICATE_TLBID = 14025
ERROR_SXS_DUPLICATE_PROGID = 14026
ERROR_SXS_DUPLICATE_ASSEMBLY_NAME = 14027
ERROR_SXS_FILE_HASH_MISMATCH = 14028
ERROR_SXS_POLICY_PARSE_ERROR = 14029
ERROR_SXS_XML_E_MISSINGQUOTE = 14030
ERROR_SXS_XML_E_COMMENTSYNTAX = 14031
ERROR_SXS_XML_E_BADSTARTNAMECHAR = 14032
ERROR_SXS_XML_E_BADNAMECHAR = 14033
ERROR_SXS_XML_E_BADCHARINSTRING = 14034
ERROR_SXS_XML_E_XMLDECLSYNTAX = 14035
ERROR_SXS_XML_E_BADCHARDATA = 14036
ERROR_SXS_XML_E_MISSINGWHITESPACE = 14037
ERROR_SXS_XML_E_EXPECTINGTAGEND = 14038
ERROR_SXS_XML_E_MISSINGSEMICOLON = 14039
ERROR_SXS_XML_E_UNBALANCEDPAREN = 14040
ERROR_SXS_XML_E_INTERNALERROR = 14041
ERROR_SXS_XML_E_UNEXPECTED_WHITESPACE = 14042
ERROR_SXS_XML_E_INCOMPLETE_ENCODING = 14043
ERROR_SXS_XML_E_MISSING_PAREN = 14044
ERROR_SXS_XML_E_EXPECTINGCLOSEQUOTE = 14045
ERROR_SXS_XML_E_MULTIPLE_COLONS = 14046
ERROR_SXS_XML_E_INVALID_DECIMAL = 14047
ERROR_SXS_XML_E_INVALID_HEXIDECIMAL = 14048
ERROR_SXS_XML_E_INVALID_UNICODE = 14049
ERROR_SXS_XML_E_WHITESPACEORQUESTIONMARK = 14050
ERROR_SXS_XML_E_UNEXPECTEDENDTAG = 14051
ERROR_SXS_XML_E_UNCLOSEDTAG = 4052
ERROR_SXS_XML_E_DUPLICATEATTRIBUTE = 14053
ERROR_SXS_XML_E_MULTIPLEROOTS = 14054
ERROR_SXS_XML_E_INVALIDATROOTLEVEL = 14055
ERROR_SXS_XML_E_BADXMLDECL = 14056
ERROR_SXS_XML_E_MISSINGROOT = 14057
ERROR_SXS_XML_E_UNEXPECTEDEOF = 14058
ERROR_SXS_XML_E_BADPEREFINSUBSET = 14059
ERROR_SXS_XML_E_UNCLOSEDSTARTTAG = 14060
ERROR_SXS_XML_E_UNCLOSEDENDTAG = 14061
ERROR_SXS_XML_E_UNCLOSEDSTRING = 14062
ERROR_SXS_XML_E_UNCLOSEDCOMMENT = 14063
ERROR_SXS_XML_E_UNCLOSEDDECL = 14064
ERROR_SXS_XML_E_UNCLOSEDCDATA = 14065
ERROR_SXS_XML_E_RESERVEDNAMESPACE = 14066
ERROR_SXS_XML_E_INVALIDENCODING = 14067
ERROR_SXS_XML_E_INVALIDSWITCH = 14068
ERROR_SXS_XML_E_BADXMLCASE = 14069
ERROR_SXS_XML_E_INVALID_STANDALONE = 14070
ERROR_SXS_XML_E_UNEXPECTED_STANDALONE = 14071
ERROR_SXS_XML_E_INVALID_VERSION = 14072
ERROR_SXS_XML_E_MISSINGEQUALS = 14073
ERROR_SXS_PROTECTION_RECOVERY_FAILED = 14074
ERROR_SXS_PROTECTION_PUBLIC_KEY_TOO_SHORT = 14075
ERROR_SXS_PROTECTION_CATALOG_NOT_VALID = 14076
ERROR_SXS_UNTRANSLATABLE_HRESULT = 14077
ERROR_SXS_PROTECTION_CATALOG_FILE_MISSING = 14078
ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE = 14079
ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME = 14080
ERROR_IPSEC_QM_POLICY_EXISTS = 13000
ERROR_IPSEC_QM_POLICY_NOT_FOUND = 13001
ERROR_IPSEC_QM_POLICY_IN_USE = 13002
ERROR_IPSEC_MM_POLICY_EXISTS = 13003
ERROR_IPSEC_MM_POLICY_NOT_FOUND = 13004
ERROR_IPSEC_MM_POLICY_IN_USE = 13005
ERROR_IPSEC_MM_FILTER_EXISTS = 13006
ERROR_IPSEC_MM_FILTER_NOT_FOUND = 13007
ERROR_IPSEC_TRANSPORT_FILTER_EXISTS = 13008
ERROR_IPSEC_TRANSPORT_FILTER_NOT_FOUND = 13009
ERROR_IPSEC_MM_AUTH_EXISTS = 13010
ERROR_IPSEC_MM_AUTH_NOT_FOUND = 13011
ERROR_IPSEC_MM_AUTH_IN_USE = 13012
ERROR_IPSEC_DEFAULT_MM_POLICY_NOT_FOUND = 13013
ERROR_IPSEC_DEFAULT_MM_AUTH_NOT_FOUND = 13014
ERROR_IPSEC_DEFAULT_QM_POLICY_NOT_FOUND = 13015
ERROR_IPSEC_TUNNEL_FILTER_EXISTS = 13016
ERROR_IPSEC_TUNNEL_FILTER_NOT_FOUND = 13017
ERROR_IPSEC_MM_FILTER_PENDING_DELETION = 13018
ERROR_IPSEC_TRANSPORT_FILTER_PENDING_DELETION = 13019
ERROR_IPSEC_TUNNEL_FILTER_PENDING_DELETION = 13020
ERROR_IPSEC_MM_POLICY_PENDING_DELETION = 13021
ERROR_IPSEC_MM_AUTH_PENDING_DELETION = 13022
ERROR_IPSEC_QM_POLICY_PENDING_DELETION = 13023

WARNING_IPSEC_MM_POLICY_PRUNED = 13024
WARNING_IPSEC_QM_POLICY_PRUNED = 13025

ERROR_IPSEC_IKE_NEG_STATUS_BEGIN = 13800
ERROR_IPSEC_IKE_AUTH_FAIL = 13801
ERROR_IPSEC_IKE_ATTRIB_FAIL = 13802
ERROR_IPSEC_IKE_NEGOTIATION_PENDING = 13803
ERROR_IPSEC_IKE_GENERAL_PROCESSING_ERROR = 13804
ERROR_IPSEC_IKE_TIMED_OUT = 13805
ERROR_IPSEC_IKE_NO_CERT = 13806
ERROR_IPSEC_IKE_SA_DELETED = 13807
ERROR_IPSEC_IKE_SA_REAPED = 13808
ERROR_IPSEC_IKE_MM_ACQUIRE_DROP = 13809
ERROR_IPSEC_IKE_QM_ACQUIRE_DROP = 13810
ERROR_IPSEC_IKE_QUEUE_DROP_MM = 13811
ERROR_IPSEC_IKE_QUEUE_DROP_NO_MM = 13812
ERROR_IPSEC_IKE_DROP_NO_RESPONSE = 13813
ERROR_IPSEC_IKE_MM_DELAY_DROP = 13814
ERROR_IPSEC_IKE_QM_DELAY_DROP = 13815
ERROR_IPSEC_IKE_ERROR = 13816
ERROR_IPSEC_IKE_CRL_FAILED = 13817
ERROR_IPSEC_IKE_INVALID_KEY_USAGE = 13818
ERROR_IPSEC_IKE_INVALID_CERT_TYPE = 13819
ERROR_IPSEC_IKE_NO_PRIVATE_KEY = 13820
ERROR_IPSEC_IKE_DH_FAIL = 13822
ERROR_IPSEC_IKE_INVALID_HEADER = 13824
ERROR_IPSEC_IKE_NO_POLICY = 13825
ERROR_IPSEC_IKE_INVALID_SIGNATURE = 13826
ERROR_IPSEC_IKE_KERBEROS_ERROR = 13827
ERROR_IPSEC_IKE_NO_PUBLIC_KEY = 13828
ERROR_IPSEC_IKE_PROCESS_ERR = 13829
ERROR_IPSEC_IKE_PROCESS_ERR_SA = 13830
ERROR_IPSEC_IKE_PROCESS_ERR_PROP = 13831
ERROR_IPSEC_IKE_PROCESS_ERR_TRANS = 13832
ERROR_IPSEC_IKE_PROCESS_ERR_KE = 13833
ERROR_IPSEC_IKE_PROCESS_ERR_ID = 13834
ERROR_IPSEC_IKE_PROCESS_ERR_CERT = 13835
ERROR_IPSEC_IKE_PROCESS_ERR_CERT_REQ = 13836
ERROR_IPSEC_IKE_PROCESS_ERR_HASH = 13837
ERROR_IPSEC_IKE_PROCESS_ERR_SIG = 13838
ERROR_IPSEC_IKE_PROCESS_ERR_NONCE = 13839
ERROR_IPSEC_IKE_PROCESS_ERR_NOTIFY = 13840
ERROR_IPSEC_IKE_PROCESS_ERR_DELETE = 13841
ERROR_IPSEC_IKE_PROCESS_ERR_VENDOR = 13842
ERROR_IPSEC_IKE_INVALID_PAYLOAD = 13843
ERROR_IPSEC_IKE_LOAD_SOFT_SA = 13844
ERROR_IPSEC_IKE_SOFT_SA_TORN_DOWN = 13845
ERROR_IPSEC_IKE_INVALID_COOKIE = 13846
ERROR_IPSEC_IKE_NO_PEER_CERT = 13847
ERROR_IPSEC_IKE_PEER_CRL_FAILED = 13848
ERROR_IPSEC_IKE_POLICY_CHANGE = 13849
ERROR_IPSEC_IKE_NO_MM_POLICY = 13850
ERROR_IPSEC_IKE_NOTCBPRIV = 13851
ERROR_IPSEC_IKE_SECLOADFAIL = 13852
ERROR_IPSEC_IKE_FAILSSPINIT = 13853
ERROR_IPSEC_IKE_FAILQUERYSSP = 13854
ERROR_IPSEC_IKE_SRVACQFAIL = 13855
ERROR_IPSEC_IKE_SRVQUERYCRED = 13856
ERROR_IPSEC_IKE_GETSPIFAIL = 13857
ERROR_IPSEC_IKE_INVALID_FILTER = 13858
ERROR_IPSEC_IKE_OUT_OF_MEMORY = 13859
ERROR_IPSEC_IKE_ADD_UPDATE_KEY_FAILED = 13860
ERROR_IPSEC_IKE_INVALID_POLICY = 13861
ERROR_IPSEC_IKE_UNKNOWN_DOI = 13862
ERROR_IPSEC_IKE_INVALID_SITUATION = 13863
ERROR_IPSEC_IKE_DH_FAILURE = 13864
ERROR_IPSEC_IKE_INVALID_GROUP = 13865
ERROR_IPSEC_IKE_ENCRYPT = 13866
ERROR_IPSEC_IKE_DECRYPT = 13867
ERROR_IPSEC_IKE_POLICY_MATCH = 13868
ERROR_IPSEC_IKE_UNSUPPORTED_ID = 13869
ERROR_IPSEC_IKE_INVALID_HASH = 13870
ERROR_IPSEC_IKE_INVALID_HASH_ALG = 13871
ERROR_IPSEC_IKE_INVALID_HASH_SIZE = 13872
ERROR_IPSEC_IKE_INVALID_ENCRYPT_ALG = 13873
ERROR_IPSEC_IKE_INVALID_AUTH_ALG = 13874
ERROR_IPSEC_IKE_INVALID_SIG = 13875
ERROR_IPSEC_IKE_LOAD_FAILED = 13876
ERROR_IPSEC_IKE_RPC_DELETE = 13877
ERROR_IPSEC_IKE_BENIGN_REINIT = 13878
ERROR_IPSEC_IKE_INVALID_RESPONDER_LIFETIME_NOTIFY = 13879
ERROR_IPSEC_IKE_INVALID_CERT_KEYLEN = 13881
ERROR_IPSEC_IKE_MM_LIMIT = 13882
ERROR_IPSEC_IKE_NEGOTIATION_DISABLED = 13883
ERROR_IPSEC_IKE_NEG_STATUS_END = 13884

SEVERITY_SUCCESS = 0
SEVERITY_ERROR = 1

FACILITY_NT_BIT = $10000000

E_UNEXPECTED = $8000FFFF
E_NOTIMPL = $80004001
E_OUTOFMEMORY = $8007000E
E_INVALIDARG = $80070057
E_NOINTERFACE = $80004002
E_POINTER = $80004003
E_HANDLE = $80070006
E_ABORT = $80004004
E_FAIL = $80004005
E_ACCESSDENIED = $80070005
E_PENDING = $8000000A

CO_E_INIT_TLS = $80004006
CO_E_INIT_SHARED_ALLOCATOR = $80004007
CO_E_INIT_MEMORY_ALLOCATOR = $80004008
CO_E_INIT_CLASS_CACHE = $80004009
CO_E_INIT_RPC_CHANNEL = $8000400A
CO_E_INIT_TLS_SET_CHANNEL_CONTROL = $8000400B
CO_E_INIT_TLS_CHANNEL_CONTROL = $8000400C
CO_E_INIT_UNACCEPTED_USER_ALLOCATOR = $8000400D
CO_E_INIT_SCM_MUTEX_EXISTS = $8000400E
CO_E_INIT_SCM_FILE_MAPPING_EXISTS = $8000400F
CO_E_INIT_SCM_MAP_VIEW_OF_FILE = $80004010
CO_E_INIT_SCM_EXEC_FAILURE = $80004011
CO_E_INIT_ONLY_SINGLE_THREADED = $80004012
CO_E_CANT_REMOTE = $80004013
CO_E_BAD_SERVER_NAME = $80004014
CO_E_WRONG_SERVER_IDENTITY = $80004015
CO_E_OLE1DDE_DISABLED = $80004016
CO_E_RUNAS_SYNTAX = $80004017
CO_E_CREATEPROCESS_FAILURE = $80004018
CO_E_RUNAS_CREATEPROCESS_FAILURE = $80004019
CO_E_RUNAS_LOGON_FAILURE = $8000401A
CO_E_LAUNCH_PERMSSION_DENIED = $8000401B
CO_E_START_SERVICE_FAILURE = $8000401C
CO_E_REMOTE_COMMUNICATION_FAILURE = $8000401D
CO_E_SERVER_START_TIMEOUT = $8000401E
CO_E_CLSREG_INCONSISTENT = $8000401F
CO_E_IIDREG_INCONSISTENT = $80004020
CO_E_NOT_SUPPORTED = $80004021
CO_E_RELOAD_DLL = $80004022
CO_E_MSI_ERROR = $80004023
CO_E_ATTEMPT_TO_CREATE_OUTSIDE_CLIENT_CONTEXT = $80004024
CO_E_SERVER_PAUSED = $80004025
CO_E_SERVER_NOT_PAUSED = $80004026
CO_E_CLASS_DISABLED = $80004027
CO_E_CLRNOTAVAILABLE = $80004028
CO_E_ASYNC_WORK_REJECTED = $80004029
CO_E_SERVER_INIT_TIMEOUT = $8000402A
CO_E_NO_SECCTX_IN_ACTIVATE = $8000402B
CO_E_TRACKER_CONFIG = $80004030
CO_E_THREADPOOL_CONFIG = $80004031
CO_E_SXS_CONFIG = $80004032
CO_E_MALFORMED_SPN = $80004033

S_OK = 0
S_FALSE = 1

OLE_E_FIRST = $80040000
OLE_E_LAST  = $800400FF
OLE_S_FIRST = $40000
OLE_S_LAST  = $400FF
OLE_E_OLEVERB = $80040000
OLE_E_ADVF = $80040001
OLE_E_ENUM_NOMORE = $80040002
OLE_E_ADVISENOTSUPPORTED = $80040003
OLE_E_NOCONNECTION = $80040004
OLE_E_NOTRUNNING = $80040005
OLE_E_NOCACHE = $80040006
OLE_E_BLANK = $80040007
OLE_E_CLASSDIFF = $80040008
OLE_E_CANT_GETMONIKER = $80040009
OLE_E_CANT_BINDTOSOURCE = $8004000A
OLE_E_STATIC = $8004000B
OLE_E_PROMPTSAVECANCELLED = $8004000C
OLE_E_INVALIDRECT = $8004000D
OLE_E_WRONGCOMPOBJ = $8004000E
OLE_E_INVALIDHWND = $8004000F
OLE_E_NOT_INPLACEACTIVE = $80040010
OLE_E_CANTCONVERT = $80040011
OLE_E_NOSTORAGE = $80040012

DV_E_FORMATETC = $80040064
DV_E_DVTARGETDEVICE = $80040065
DV_E_STGMEDIUM = $80040066
DV_E_STATDATA = $80040067
DV_E_LINDEX = $80040068
DV_E_TYMED = $80040069
DV_E_CLIPFORMAT = $8004006A
DV_E_DVASPECT = $8004006B
DV_E_DVTARGETDEVICE_SIZE = $8004006C
DV_E_NOIVIEWOBJECT = $8004006D

DRAGDROP_E_FIRST = $80040100
DRAGDROP_E_LAST = $8004010F
DRAGDROP_S_FIRST = $40100
DRAGDROP_S_LAST = $4010F
DRAGDROP_E_NOTREGISTERED = $80040100
DRAGDROP_E_ALREADYREGISTERED = $80040101
DRAGDROP_E_INVALIDHWND = $80040102

CLASSFACTORY_E_FIRST = $80040110
CLASSFACTORY_E_LAST = $8004011F
CLASSFACTORY_S_FIRST = $40110
CLASSFACTORY_S_LAST = $4011F
CLASS_E_NOAGGREGATION = $80040110
CLASS_E_CLASSNOTAVAILABLE = $80040111
CLASS_E_NOTLICENSED = $80040112

MARSHAL_E_FIRST = $80040120
MARSHAL_E_LAST = $8004012F
MARSHAL_S_FIRST = $40120
MARSHAL_S_LAST = $4012F

DATA_E_FIRST = $80040130
DATA_E_LAST = $8004013F
DATA_S_FIRST = $00040130
DATA_S_LAST = $0004013F

VIEW_E_FIRST = $80040140
VIEW_E_LAST = $8004014F
VIEW_S_FIRST = $40140
VIEW_S_LAST = $4014F
VIEW_E_DRAW = $80040140

REGDB_E_FIRST = $80040150
REGDB_E_LAST = $8004015F
REGDB_S_FIRST = $40150
REGDB_S_LAST = $4015F
REGDB_E_READREGDB = $80040150
REGDB_E_WRITEREGDB = $80040151
REGDB_E_KEYMISSING = $80040152
REGDB_E_INVALIDVALUE = $80040153
REGDB_E_CLASSNOTREG = $80040154
REGDB_E_IIDNOTREG = $80040155
REGDB_E_BADTHREADINGMODEL = $80040156

CAT_E_FIRST = $80040160
CAT_E_LAST = $80040161
CAT_E_CATIDNOEXIST = $80040160
CAT_E_NODESCRIPTION = $80040161

CS_E_FIRST = $80040164
CS_E_LAST = $8004016F
CS_E_PACKAGE_NOTFOUND = $80040164
CS_E_NOT_DELETABLE = $80040165
CS_E_CLASS_NOTFOUND = $80040166
CS_E_INVALID_VERSION = $80040167
CS_E_NO_CLASSSTORE = $80040168
CS_E_OBJECT_NOTFOUND = $80040169
CS_E_OBJECT_ALREADY_EXISTS = $8004016A
CS_E_INVALID_PATH = $8004016B
CS_E_NETWORK_ERROR = $8004016C
CS_E_ADMIN_LIMIT_EXCEEDED = $8004016D
CS_E_SCHEMA_MISMATCH = $8004016E
CS_E_INTERNAL_ERROR = $8004016F

CACHE_E_FIRST = $80040170
CACHE_E_LAST = $8004017F
CACHE_S_FIRST = $40170
CACHE_S_LAST = $4017F
CACHE_E_NOCACHE_UPDATED = $80040170

OLEOBJ_E_FIRST = $80040180
OLEOBJ_E_LAST = $8004018F
OLEOBJ_S_FIRST = $40180
OLEOBJ_S_LAST = $4018F
OLEOBJ_E_NOVERBS = $80040180
OLEOBJ_E_INVALIDVERB = $80040181

CLIENTSITE_E_FIRST = $80040190
CLIENTSITE_E_LAST = $8004019F
CLIENTSITE_S_FIRST = $40190
CLIENTSITE_S_LAST = $4019F

INPLACE_E_NOTUNDOABLE = $800401A0
INPLACE_E_NOTOOLSPACE = $800401A1
INPLACE_E_FIRST = $800401A0
INPLACE_E_LAST = $800401AF
INPLACE_S_FIRST = $401A0
INPLACE_S_LAST = $401AF

ENUM_E_FIRST = $800401B0
ENUM_E_LAST = $800401BF
ENUM_S_FIRST = $401B0
ENUM_S_LAST = $401BF

CONVERT10_E_FIRST = $800401C0
CONVERT10_E_LAST = $800401CF
CONVERT10_S_FIRST = $401C0
CONVERT10_S_LAST = $401CF
CONVERT10_E_OLESTREAM_GET = $800401C0
CONVERT10_E_OLESTREAM_PUT = $800401C1
CONVERT10_E_OLESTREAM_FMT = $800401C2
CONVERT10_E_OLESTREAM_BITMAP_TO_DIB = $800401C3
CONVERT10_E_STG_FMT = $800401C4
CONVERT10_E_STG_NO_STD_STREAM = $800401C5
CONVERT10_E_STG_DIB_TO_BITMAP = $800401C6

CLIPBRD_E_FIRST = $800401D0
CLIPBRD_E_LAST = $800401DF
CLIPBRD_S_FIRST = $401D0
CLIPBRD_S_LAST = $401DF
CLIPBRD_E_CANT_OPEN = $800401D0
CLIPBRD_E_CANT_EMPTY = $800401D1
CLIPBRD_E_CANT_SET = $800401D2
CLIPBRD_E_BAD_DATA = $800401D3
CLIPBRD_E_CANT_CLOSE = $800401D4

MK_E_FIRST = $800401E0
MK_E_LAST = $800401EF
MK_S_FIRST = $401E0
MK_S_LAST = $401EF
MK_E_CONNECTMANUALLY = $800401E0
MK_E_EXCEEDEDDEADLINE = $800401E1
MK_E_NEEDGENERIC = $800401E2
MK_E_UNAVAILABLE = $800401E3
MK_E_SYNTAX = $800401E4
MK_E_NOOBJECT = $800401E5
MK_E_INVALIDEXTENSION = $800401E6
MK_E_INTERMEDIATEINTERFACENOTSUPPORTED = $800401E7
MK_E_NOTBINDABLE = $800401E8
MK_E_NOTBOUND = $800401E9
MK_E_CANTOPENFILE = $800401EA
MK_E_MUSTBOTHERUSER = $800401EB
MK_E_NOINVERSE = $800401EC
MK_E_NOSTORAGE = $800401ED
MK_E_NOPREFIX = $800401EE
MK_E_ENUMERATION_FAILED = $800401EF

CO_E_FIRST = $800401F0
CO_E_LAST = $800401FF
CO_S_FIRST = $401F0
CO_S_LAST = $401FF
CO_E_NOTINITIALIZED = $800401F0
CO_E_ALREADYINITIALIZED = $800401F1
CO_E_CANTDETERMINECLASS = $800401F2
CO_E_CLASSSTRING = $800401F3
CO_E_IIDSTRING = $800401F4
CO_E_APPNOTFOUND = $800401F5
CO_E_APPSINGLEUSE = $800401F6
CO_E_ERRORINAPP = $800401F7
CO_E_DLLNOTFOUND = $800401F8
CO_E_ERRORINDLL = $800401F9
CO_E_WRONGOSFORAPP = $800401FA
CO_E_OBJNOTREG = $800401FB
CO_E_OBJISREG = $800401FC
CO_E_OBJNOTCONNECTED = $800401FD
CO_E_APPDIDNTREG = $800401FE
CO_E_RELEASED = $800401FF

EVENT_E_FIRST = $80040200
EVENT_E_LAST = $8004021F
EVENT_S_FIRST = $40200
EVENT_S_LAST = $4021F
EVENT_S_SOME_SUBSCRIBERS_FAILED = $40200
EVENT_E_ALL_SUBSCRIBERS_FAILED = $80040201
EVENT_S_NOSUBSCRIBERS = $40202
EVENT_E_QUERYSYNTAX = $80040203
EVENT_E_QUERYFIELD = $80040204
EVENT_E_INTERNALEXCEPTION = $80040205
EVENT_E_INTERNALERROR = $80040206
EVENT_E_INVALID_PER_USER_SID = $80040207
EVENT_E_USER_EXCEPTION = $80040208
EVENT_E_TOO_MANY_METHODS = $80040209
EVENT_E_MISSING_EVENTCLASS = $8004020A
EVENT_E_NOT_ALL_REMOVED = $8004020B
EVENT_E_COMPLUS_NOT_INSTALLED = $8004020C
EVENT_E_CANT_MODIFY_OR_DELETE_UNCONFIGURED_OBJECT = $8004020D
EVENT_E_CANT_MODIFY_OR_DELETE_CONFIGURED_OBJECT = $8004020E
EVENT_E_INVALID_EVENT_CLASS_PARTITION = $8004020F
EVENT_E_PER_USER_SID_NOT_LOGGED_ON = $80040210

XACT_E_FIRST = $8004D000
XACT_E_LAST = $8004D029
XACT_S_FIRST = $4D000
XACT_S_LAST = $4D010
XACT_E_ALREADYOTHERSINGLEPHASE = $8004D000
XACT_E_CANTRETAIN = $8004D001
XACT_E_COMMITFAILED = $8004D002
XACT_E_COMMITPREVENTED = $8004D003
XACT_E_HEURISTICABORT = $8004D004
XACT_E_HEURISTICCOMMIT = $8004D005
XACT_E_HEURISTICDAMAGE = $8004D006
XACT_E_HEURISTICDANGER = $8004D007
XACT_E_ISOLATIONLEVEL = $8004D008
XACT_E_NOASYNC = $8004D009
XACT_E_NOENLIST = $8004D00A
XACT_E_NOISORETAIN = $8004D00B
XACT_E_NORESOURCE = $8004D00C
XACT_E_NOTCURRENT = $8004D00D
XACT_E_NOTRANSACTION = $8004D00E
XACT_E_NOTSUPPORTED = $8004D00F
XACT_E_UNKNOWNRMGRID = $8004D010
XACT_E_WRONGSTATE = $8004D011
XACT_E_WRONGUOW = $8004D012
XACT_E_XTIONEXISTS = $8004D013
XACT_E_NOIMPORTOBJECT = $8004D014
XACT_E_INVALIDCOOKIE = $8004D015
XACT_E_INDOUBT = $8004D016
XACT_E_NOTIMEOUT = $8004D017
XACT_E_ALREADYINPROGRESS = $8004D018
XACT_E_ABORTED = $8004D019
XACT_E_LOGFULL = $8004D01A
XACT_E_TMNOTAVAILABLE = $8004D01B
XACT_E_CONNECTION_DOWN = $8004D01C
XACT_E_CONNECTION_DENIED = $8004D01D
XACT_E_REENLISTTIMEOUT = $8004D01E
XACT_E_TIP_CONNECT_FAILED = $8004D01F
XACT_E_TIP_PROTOCOL_ERROR = $8004D020
XACT_E_TIP_PULL_FAILED = $8004D021
XACT_E_DEST_TMNOTAVAILABLE = $8004D022
XACT_E_TIP_DISABLED = $8004D023
XACT_E_NETWORK_TX_DISABLED = $8004D024
XACT_E_PARTNER_NETWORK_TX_DISABLED = $8004D025
XACT_E_XA_TX_DISABLED = $8004D026
XACT_E_UNABLE_TO_READ_DTC_CONFIG = $8004D027
XACT_E_UNABLE_TO_LOAD_DTC_PROXY = $8004D028
XACT_E_ABORTING = $8004D029
XACT_E_CLERKNOTFOUND = $8004D080
XACT_E_CLERKEXISTS = $8004D081
XACT_E_RECOVERYINPROGRESS = $8004D082
XACT_E_TRANSACTIONCLOSED = $8004D083
XACT_E_INVALIDLSN = $8004D084
XACT_E_REPLAYREQUEST = $8004D085
XACT_S_ASYNC = $4D000
XACT_S_DEFECT = $4D001
XACT_S_READONLY = $4D002
XACT_S_SOMENORETAIN = $4D003
XACT_S_OKINFORM = $4D004
XACT_S_MADECHANGESCONTENT = $4D005
XACT_S_MADECHANGESINFORM = $4D006
XACT_S_ALLNORETAIN = $4D007
XACT_S_ABORTING = $4D008
XACT_S_SINGLEPHASE = $4D009
XACT_S_LOCALLY_OK = $4D00A
XACT_S_LASTRESOURCEMANAGER = $4D010

CONTEXT_E_FIRST = $8004E000
CONTEXT_E_LAST = $8004E02F
CONTEXT_S_FIRST = $4E000
CONTEXT_S_LAST = $4E02F
CONTEXT_E_ABORTED = $8004E002
CONTEXT_E_ABORTING = $8004E003
CONTEXT_E_NOCONTEXT = $8004E004
CONTEXT_E_WOULD_DEADLOCK = $8004E005
CONTEXT_E_SYNCH_TIMEOUT = $8004E006
CONTEXT_E_OLDREF = $8004E007
CONTEXT_E_ROLENOTFOUND = $8004E00C
CONTEXT_E_TMNOTAVAILABLE = $8004E00F

CO_E_ACTIVATIONFAILED = $8004E021
CO_E_ACTIVATIONFAILED_EVENTLOGGED = $8004E022
CO_E_ACTIVATIONFAILED_CATALOGERROR = $8004E023
CO_E_ACTIVATIONFAILED_TIMEOUT = $8004E024
CO_E_INITIALIZATIONFAILED = $8004E025

CONTEXT_E_NOJIT = $8004E026
CONTEXT_E_NOTRANSACTION = $8004E027

CO_E_THREADINGMODEL_CHANGED = $8004E028
CO_E_NOIISINTRINSICS = $8004E029
CO_E_NOCOOKIES = $8004E02A
CO_E_DBERROR = $8004E02B
CO_E_NOTPOOLED = $8004E02C
CO_E_NOTCONSTRUCTED = $8004E02D
CO_E_NOSYNCHRONIZATION = $8004E02E
CO_E_ISOLEVELMISMATCH = $8004E02F

OLE_S_USEREG = $40000
OLE_S_STATIC = $40001
OLE_S_MAC_CLIPFORMAT = $40002

DRAGDROP_S_DROP = $40100
DRAGDROP_S_CANCEL = $40101
DRAGDROP_S_USEDEFAULTCURSORS = $40102

DATA_S_SAMEFORMATETC = $40130

VIEW_S_ALREADY_FROZEN = $40140

CACHE_S_FORMATETC_NOTSUPPORTED = $40170
CACHE_S_SAMECACHE = $40171
CACHE_S_SOMECACHES_NOTUPDATED = $40172

OLEOBJ_S_INVALIDVERB = $40180
OLEOBJ_S_CANNOT_DOVERB_NOW = $40181
OLEOBJ_S_INVALIDHWND = $40182

INPLACE_S_TRUNCATED = $401A0

CONVERT10_S_NO_PRESENTATION = $401C0

MK_S_REDUCED_TO_SELF = $401E2
MK_S_ME = $401E4
MK_S_HIM = $401E5
MK_S_US = $401E6
MK_S_MONIKERALREADYREGISTERED = $401E7

SCHED_S_TASK_READY = $41300
SCHED_S_TASK_RUNNING = $41301
SCHED_S_TASK_DISABLED = $41302
SCHED_S_TASK_HAS_NOT_RUN = $41303
SCHED_S_TASK_NO_MORE_RUNS = $41304
SCHED_S_TASK_NOT_SCHEDULED = $41305
SCHED_S_TASK_TERMINATED = $41306
SCHED_S_TASK_NO_VALID_TRIGGERS = $41307
SCHED_S_EVENT_TRIGGER = $41308
SCHED_E_TRIGGER_NOT_FOUND = $80041309
SCHED_E_TASK_NOT_READY = $8004130A
SCHED_E_TASK_NOT_RUNNING = $8004130B
SCHED_E_SERVICE_NOT_INSTALLED = $8004130C
SCHED_E_CANNOT_OPEN_TASK = $8004130D
SCHED_E_INVALID_TASK = $8004130E
SCHED_E_ACCOUNT_INFORMATION_NOT_SET = $8004130F
SCHED_E_ACCOUNT_NAME_NOT_FOUND = $80041310
SCHED_E_ACCOUNT_DBASE_CORRUPT = $80041311
SCHED_E_NO_SECURITY_SERVICES = $80041312
SCHED_E_UNKNOWN_OBJECT_VERSION = $80041313
SCHED_E_UNSUPPORTED_ACCOUNT_OPTION = $80041314
SCHED_E_SERVICE_NOT_RUNNING = $80041315

CO_E_CLASS_CREATE_FAILED = $80080001
CO_E_SCM_ERROR = $80080002
CO_E_SCM_RPC_FAILURE = $80080003
CO_E_BAD_PATH = $80080004
CO_E_SERVER_EXEC_FAILURE = $80080005
CO_E_OBJSRV_RPC_FAILURE = $80080006

MK_E_NO_NORMALIZED = $80080007

CO_E_SERVER_STOPPING = $80080008

MEM_E_INVALID_ROOT = $80080009
MEM_E_INVALID_LINK = $80080010
MEM_E_INVALID_SIZE = $80080011

CO_S_NOTALLINTERFACES = $80012
CO_S_MACHINENAMENOTFOUND = $80013

DISP_E_UNKNOWNINTERFACE = $80020001
DISP_E_MEMBERNOTFOUND = $80020003
DISP_E_PARAMNOTFOUND = $80020004
DISP_E_TYPEMISMATCH = $80020005
DISP_E_UNKNOWNNAME = $80020006
DISP_E_NONAMEDARGS = $80020007
DISP_E_BADVARTYPE = $80020008
DISP_E_EXCEPTION = $80020009
DISP_E_OVERFLOW = $8002000A
DISP_E_BADINDEX = $8002000B
DISP_E_UNKNOWNLCID = $8002000C
DISP_E_ARRAYISLOCKED = $8002000D
DISP_E_BADPARAMCOUNT = $8002000E
DISP_E_PARAMNOTOPTIONAL = $8002000F
DISP_E_BADCALLEE = $80020010
DISP_E_NOTACOLLECTION = $80020011
DISP_E_DIVBYZERO = $80020012
DISP_E_BUFFERTOOSMALL = $80020013

TYPE_E_BUFFERTOOSMALL = $80028016
TYPE_E_FIELDNOTFOUND = $80028017
TYPE_E_INVDATAREAD = $80028018
TYPE_E_UNSUPFORMAT = $80028019
TYPE_E_REGISTRYACCESS = $8002801C
TYPE_E_LIBNOTREGISTERED = $8002801D
TYPE_E_UNDEFINEDTYPE = $80028027
TYPE_E_QUALIFIEDNAMEDISALLOWED = $80028028
TYPE_E_INVALIDSTATE = $80028029
TYPE_E_WRONGTYPEKIND = $8002802A
TYPE_E_ELEMENTNOTFOUND = $8002802B
TYPE_E_AMBIGUOUSNAME = $8002802C
TYPE_E_NAMECONFLICT = $8002802D
TYPE_E_UNKNOWNLCID = $8002802E
TYPE_E_DLLFUNCTIONNOTFOUND = $8002802F
TYPE_E_BADMODULEKIND = $800288BD
TYPE_E_SIZETOOBIG = $800288C5
TYPE_E_DUPLICATEID = $800288C6
TYPE_E_INVALIDID = $800288CF
TYPE_E_TYPEMISMATCH = $80028CA0
TYPE_E_OUTOFBOUNDS = $80028CA1
TYPE_E_IOERROR = $80028CA2
TYPE_E_CANTCREATETMPFILE = $80028CA3
TYPE_E_CANTLOADLIBRARY = $80029C4A
TYPE_E_INCONSISTENTPROPFUNCS = $80029C83
TYPE_E_CIRCULARTYPE = $80029C84

STG_E_INVALIDFUNCTION = $80030001
STG_E_FILENOTFOUND = $80030002
STG_E_PATHNOTFOUND = $80030003
STG_E_TOOMANYOPENFILES = $80030004
STG_E_ACCESSDENIED = $80030005
STG_E_INVALIDHANDLE = $80030006
STG_E_INSUFFICIENTMEMORY = $80030008
STG_E_INVALIDPOINTER = $80030009
STG_E_NOMOREFILES = $80030012
STG_E_DISKISWRITEPROTECTED = $80030013
STG_E_SEEKERROR = $80030019
STG_E_WRITEFAULT = $8003001D
STG_E_READFAULT = $8003001E
STG_E_SHAREVIOLATION = $80030020
STG_E_LOCKVIOLATION = $80030021
STG_E_FILEALREADYEXISTS = $80030050
STG_E_INVALIDPARAMETER = $80030057
STG_E_MEDIUMFULL = $80030070
STG_E_PROPSETMISMATCHED = $800300F0
STG_E_ABNORMALAPIEXIT = $800300FA
STG_E_INVALIDHEADER = $800300FB
STG_E_INVALIDNAME = $800300FC
STG_E_UNKNOWN = $800300FD
STG_E_UNIMPLEMENTEDFUNCTION = $800300FE
STG_E_INVALIDFLAG = $800300FF
STG_E_INUSE = $80030100
STG_E_NOTCURRENT = $80030101
STG_E_REVERTED = $80030102
STG_E_CANTSAVE = $80030103
STG_E_OLDFORMAT = $80030104
STG_E_OLDDLL = $80030105
STG_E_SHAREREQUIRED = $80030106
STG_E_NOTFILEBASEDSTORAGE = $80030107
STG_E_EXTANTMARSHALLINGS = $80030108
STG_E_DOCFILECORRUPT = $80030109
STG_E_BADBASEADDRESS = $80030110
STG_E_DOCFILETOOLARGE = $80030111
STG_E_NOTSIMPLEFORMAT = $80030112
STG_E_INCOMPLETE = $80030201
STG_E_TERMINATED = $80030202
STG_S_CONVERTED = $30200
STG_S_BLOCK = $30201
STG_S_RETRYNOW = $30202
STG_S_MONITORING = $30203
STG_S_MULTIPLEOPENS = $30204
STG_S_CONSOLIDATIONFAILED = $30205
STG_S_CANNOTCONSOLIDATE = $30206
STG_E_STATUS_COPY_PROTECTION_FAILURE = $80030305
STG_E_CSS_AUTHENTICATION_FAILURE = $80030306
STG_E_CSS_KEY_NOT_PRESENT = $80030307
STG_E_CSS_KEY_NOT_ESTABLISHED = $80030308
STG_E_CSS_SCRAMBLED_SECTOR = $80030309
STG_E_CSS_REGION_MISMATCH = $8003030A
STG_E_RESETS_EXHAUSTED = $8003030B

RPC_E_CALL_REJECTED = $80010001
RPC_E_CALL_CANCELED = $80010002
RPC_E_CANTPOST_INSENDCALL = $80010003
RPC_E_CANTCALLOUT_INASYNCCALL = $80010004
RPC_E_CANTCALLOUT_INEXTERNALCALL = $80010005
RPC_E_CONNECTION_TERMINATED = $80010006
RPC_E_SERVER_DIED = $80010007
RPC_E_CLIENT_DIED = $80010008
RPC_E_INVALID_DATAPACKET = $80010009
RPC_E_CANTTRANSMIT_CALL = $8001000A
RPC_E_CLIENT_CANTMARSHAL_DATA = $8001000B
RPC_E_CLIENT_CANTUNMARSHAL_DATA = $8001000C
RPC_E_SERVER_CANTMARSHAL_DATA = $8001000D
RPC_E_SERVER_CANTUNMARSHAL_DATA = $8001000E
RPC_E_INVALID_DATA = $8001000F
RPC_E_INVALID_PARAMETER = $80010010
RPC_E_CANTCALLOUT_AGAIN = $80010011
RPC_E_SERVER_DIED_DNE = $80010012
RPC_E_SYS_CALL_FAILED = $80010100
RPC_E_OUT_OF_RESOURCES = $80010101
RPC_E_ATTEMPTED_MULTITHREAD = $80010102
RPC_E_NOT_REGISTERED = $80010103
RPC_E_FAULT = $80010104
RPC_E_SERVERFAULT = $80010105
RPC_E_CHANGED_MODE = $80010106
RPC_E_INVALIDMETHOD = $80010107
RPC_E_DISCONNECTED = $80010108
RPC_E_RETRY = $80010109
RPC_E_SERVERCALL_RETRYLATER = $8001010A
RPC_E_SERVERCALL_REJECTED = $8001010B
RPC_E_INVALID_CALLDATA = $8001010C
RPC_E_CANTCALLOUT_ININPUTSYNCCALL = $8001010D
RPC_E_WRONG_THREAD = $8001010E
RPC_E_THREAD_NOT_INIT = $8001010F
RPC_E_VERSION_MISMATCH = $80010110
RPC_E_INVALID_HEADER = $80010111
RPC_E_INVALID_EXTENSION = $80010112
RPC_E_INVALID_IPID = $80010113
RPC_E_INVALID_OBJECT = $80010114
RPC_S_CALLPENDING = $80010115
RPC_S_WAITONTIMER = $80010116
RPC_E_CALL_COMPLETE = $80010117
RPC_E_UNSECURE_CALL = $80010118
RPC_E_TOO_LATE = $80010119
RPC_E_NO_GOOD_SECURITY_PACKAGES = $8001011A
RPC_E_ACCESS_DENIED = $8001011B
RPC_E_REMOTE_DISABLED = $8001011C
RPC_E_INVALID_OBJREF = $8001011D
RPC_E_NO_CONTEXT = $8001011E
RPC_E_TIMEOUT = $8001011F
RPC_E_NO_SYNC = $80010120
RPC_E_FULLSIC_REQUIRED = $80010121
RPC_E_INVALID_STD_NAME = $80010122

CO_E_FAILEDTOIMPERSONATE = $80010123
CO_E_FAILEDTOGETSECCTX = $80010124
CO_E_FAILEDTOOPENTHREADTOKEN = $80010125
CO_E_FAILEDTOGETTOKENINFO = $80010126
CO_E_TRUSTEEDOESNTMATCHCLIENT = $80010127
CO_E_FAILEDTOQUERYCLIENTBLANKET = $80010128
CO_E_FAILEDTOSETDACL = $80010129
CO_E_ACCESSCHECKFAILED = $8001012A
CO_E_NETACCESSAPIFAILED = $8001012B
CO_E_WRONGTRUSTEENAMESYNTAX = $8001012C
CO_E_INVALIDSID = $8001012D
CO_E_CONVERSIONFAILED = $8001012E
CO_E_NOMATCHINGSIDFOUND = $8001012F
CO_E_LOOKUPACCSIDFAILED = $80010130
CO_E_NOMATCHINGNAMEFOUND = $80010131
CO_E_LOOKUPACCNAMEFAILED = $80010132
CO_E_SETSERLHNDLFAILED = $80010133
CO_E_FAILEDTOGETWINDIR = $80010134
CO_E_PATHTOOLONG = $80010135
CO_E_FAILEDTOGENUUID = $80010136
CO_E_FAILEDTOCREATEFILE = $80010137
CO_E_FAILEDTOCLOSEHANDLE = $80010138
CO_E_EXCEEDSYSACLLIMIT = $80010139
CO_E_ACESINWRONGORDER = $8001013A
CO_E_INCOMPATIBLESTREAMVERSION = $8001013B
CO_E_FAILEDTOOPENPROCESSTOKEN = $8001013C
CO_E_DECODEFAILED = $8001013D
CO_E_ACNOTINITIALIZED = $8001013F
CO_E_CANCEL_DISABLED = $80010140

RPC_E_UNEXPECTED = $8001FFFF

ERROR_AUDITING_DISABLED = $C0090001
ERROR_ALL_SIDS_FILTERED = $C0090002

NTE_BAD_UID = $80090001
NTE_BAD_HASH = $80090002
NTE_BAD_KEY = $80090003
NTE_BAD_LEN = $80090004
NTE_BAD_DATA = $80090005
NTE_BAD_SIGNATURE = $80090006
NTE_BAD_VER = $80090007
NTE_BAD_ALGID = $80090008
NTE_BAD_FLAGS = $80090009
NTE_BAD_TYPE = $8009000A
NTE_BAD_KEY_STATE = $8009000B
NTE_BAD_HASH_STATE = $8009000C
NTE_NO_KEY = $8009000D
NTE_NO_MEMORY = $8009000E
NTE_EXISTS = $8009000F
NTE_PERM = $80090010
NTE_NOT_FOUND = $80090011
NTE_DOUBLE_ENCRYPT = $80090012
NTE_BAD_PROVIDER = $80090013
NTE_BAD_PROV_TYPE = $80090014
NTE_BAD_PUBLIC_KEY = $80090015
NTE_BAD_KEYSET = $80090016
NTE_PROV_TYPE_NOT_DEF = $80090017
NTE_PROV_TYPE_ENTRY_BAD = $80090018
NTE_KEYSET_NOT_DEF = $80090019
NTE_KEYSET_ENTRY_BAD = $8009001A
NTE_PROV_TYPE_NO_MATCH = $8009001B
NTE_SIGNATURE_FILE_BAD = $8009001C
NTE_PROVIDER_DLL_FAIL = $8009001D
NTE_PROV_DLL_NOT_FOUND = $8009001E
NTE_BAD_KEYSET_PARAM = $8009001F
NTE_FAIL = $80090020
NTE_SYS_ERR = $80090021
NTE_SILENT_CONTEXT = $80090022
NTE_TOKEN_KEYSET_STORAGE_FULL = $80090023
NTE_TEMPORARY_PROFILE = $80090024
NTE_FIXEDPARAMETER = $80090025

SEC_E_INSUFFICIENT_MEMORY = $80090300
SEC_E_INVALID_HANDLE = $80090301
SEC_E_UNSUPPORTED_FUNCTION = $80090302
SEC_E_TARGET_UNKNOWN = $80090303
SEC_E_INTERNAL_ERROR = $80090304
SEC_E_SECPKG_NOT_FOUND = $80090305
SEC_E_NOT_OWNER = $80090306
SEC_E_CANNOT_INSTALL = $80090307
SEC_E_INVALID_TOKEN = $80090308
SEC_E_CANNOT_PACK = $80090309
SEC_E_QOP_NOT_SUPPORTED = $8009030A
SEC_E_NO_IMPERSONATION = $8009030B
SEC_E_LOGON_DENIED = $8009030C
SEC_E_UNKNOWN_CREDENTIALS = $8009030D
SEC_E_NO_CREDENTIALS = $8009030E
SEC_E_MESSAGE_ALTERED = $8009030F
SEC_E_OUT_OF_SEQUENCE = $80090310
SEC_E_NO_AUTHENTICATING_AUTHORITY = $80090311
SEC_I_CONTINUE_NEEDED = $90312
SEC_I_COMPLETE_NEEDED = $90313
SEC_I_COMPLETE_AND_CONTINUE = $90314
SEC_I_LOCAL_LOGON  = $90315
SEC_E_BAD_PKGID = $80090316
SEC_E_CONTEXT_EXPIRED = $80090317
SEC_I_CONTEXT_EXPIRED = $90317
SEC_E_INCOMPLETE_MESSAGE = $80090318
SEC_E_INCOMPLETE_CREDENTIALS = $80090320
SEC_E_BUFFER_TOO_SMALL = $80090321
SEC_I_INCOMPLETE_CREDENTIALS = $90320
SEC_I_RENEGOTIATE = $90321
SEC_E_WRONG_PRINCIPAL = $80090322
SEC_I_NO_LSA_CONTEXT = $90323
SEC_E_TIME_SKEW = $80090324
SEC_E_UNTRUSTED_ROOT = $80090325
SEC_E_ILLEGAL_MESSAGE = $80090326
SEC_E_CERT_UNKNOWN = $80090327
SEC_E_CERT_EXPIRED = $80090328
SEC_E_ENCRYPT_FAILURE = $80090329
SEC_E_DECRYPT_FAILURE = $80090330
SEC_E_ALGORITHM_MISMATCH = $80090331
SEC_E_SECURITY_QOS_FAILED = $80090332
SEC_E_UNFINISHED_CONTEXT_DELETED = $80090333
SEC_E_NO_TGT_REPLY = $80090334
SEC_E_NO_IP_ADDRESSES  = $80090335
SEC_E_WRONG_CREDENTIAL_HANDLE = $80090336
SEC_E_CRYPTO_SYSTEM_INVALID = $80090337
SEC_E_MAX_REFERRALS_EXCEEDED = $80090338
SEC_E_MUST_BE_KDC = $80090339
SEC_E_STRONG_CRYPTO_NOT_SUPPORTED = $8009033A
SEC_E_TOO_MANY_PRINCIPALS = $8009033B
SEC_E_NO_PA_DATA = $8009033C
SEC_E_PKINIT_NAME_MISMATCH = $8009033D
SEC_E_SMARTCARD_LOGON_REQUIRED = $8009033E
SEC_E_SHUTDOWN_IN_PROGRESS = $8009033F
SEC_E_KDC_INVALID_REQUEST = $80090340
SEC_E_KDC_UNABLE_TO_REFER = $80090341
SEC_E_KDC_UNKNOWN_ETYPE = $80090342
SEC_E_UNSUPPORTED_PREAUTH = $80090343
SEC_E_DELEGATION_REQUIRED = $80090345
SEC_E_BAD_BINDINGS = $80090346
SEC_E_MULTIPLE_ACCOUNTS = $80090347
SEC_E_NO_KERB_KEY = $80090348
SEC_E_CERT_WRONG_USAGE = $80090349
SEC_E_DOWNGRADE_DETECTED = $80090350
SEC_E_SMARTCARD_CERT_REVOKED = $80090351
SEC_E_ISSUING_CA_UNTRUSTED = $80090352
SEC_E_REVOCATION_OFFLINE_C = $80090353
SEC_E_PKINIT_CLIENT_FAILURE = $80090354
SEC_E_SMARTCARD_CERT_EXPIRED = $80090355
SEC_E_NO_S4U_PROT_SUPPORT = $80090356
SEC_E_CROSSREALM_DELEGATION_FAILURE = $80090357
SEC_E_REVOCATION_OFFLINE_KDC = $80090358
SEC_E_ISSUING_CA_UNTRUSTED_KDC = $80090359
SEC_E_KDC_CERT_EXPIRED = $8009035A
SEC_E_KDC_CERT_REVOKED = $8009035B
SEC_E_NO_SPM = SEC_E_INTERNAL_ERROR
SEC_E_NOT_SUPPORTED = SEC_E_UNSUPPORTED_FUNCTION

CRYPT_E_MSG_ERROR = $80091001
CRYPT_E_UNKNOWN_ALGO = $80091002
CRYPT_E_OID_FORMAT = $80091003
CRYPT_E_INVALID_MSG_TYPE = $80091004
CRYPT_E_UNEXPECTED_ENCODING = $80091005
CRYPT_E_AUTH_ATTR_MISSING = $80091006
CRYPT_E_HASH_VALUE = $80091007
CRYPT_E_INVALID_INDEX = $80091008
CRYPT_E_ALREADY_DECRYPTED = $80091009
CRYPT_E_NOT_DECRYPTED = $8009100A
CRYPT_E_RECIPIENT_NOT_FOUND = $8009100B
CRYPT_E_CONTROL_TYPE = $8009100C
CRYPT_E_ISSUER_SERIALNUMBER = $8009100D
CRYPT_E_SIGNER_NOT_FOUND = $8009100E
CRYPT_E_ATTRIBUTES_MISSING = $8009100F
CRYPT_E_STREAM_MSG_NOT_READY = $80091010
CRYPT_E_STREAM_INSUFFICIENT_DATA = $80091011
CRYPT_I_NEW_PROTECTION_REQUIRED = $91012
CRYPT_E_BAD_LEN = $80092001
CRYPT_E_BAD_ENCODE = $80092002
CRYPT_E_FILE_ERROR = $80092003
CRYPT_E_NOT_FOUND = $80092004
CRYPT_E_EXISTS = $80092005
CRYPT_E_NO_PROVIDER = $80092006
CRYPT_E_SELF_SIGNED = $80092007
CRYPT_E_DELETED_PREV = $80092008
CRYPT_E_NO_MATCH = $80092009
CRYPT_E_UNEXPECTED_MSG_TYPE = $8009200A
CRYPT_E_NO_KEY_PROPERTY = $8009200B
CRYPT_E_NO_DECRYPT_CERT = $8009200C
CRYPT_E_BAD_MSG = $8009200D
CRYPT_E_NO_SIGNER = $8009200E
CRYPT_E_PENDING_CLOSE = $8009200F
CRYPT_E_REVOKED = $80092010
CRYPT_E_NO_REVOCATION_DLL = $80092011
CRYPT_E_NO_REVOCATION_CHECK = $80092012
CRYPT_E_REVOCATION_OFFLINE  = $80092013
CRYPT_E_NOT_IN_REVOCATION_DATABASE = $80092014
CRYPT_E_INVALID_NUMERIC_STRING = $80092020
CRYPT_E_INVALID_PRINTABLE_STRING = $80092021
CRYPT_E_INVALID_IA5_STRING = $80092022
CRYPT_E_INVALID_X500_STRING = $80092023
CRYPT_E_NOT_CHAR_STRING = $80092024
CRYPT_E_FILERESIZED = $80092025
CRYPT_E_SECURITY_SETTINGS = $80092026
CRYPT_E_NO_VERIFY_USAGE_DLL = $80092027
CRYPT_E_NO_VERIFY_USAGE_CHECK = $80092028
CRYPT_E_VERIFY_USAGE_OFFLINE = $80092029
CRYPT_E_NOT_IN_CTL = $8009202A
CRYPT_E_NO_TRUSTED_SIGNER = $8009202B
CRYPT_E_MISSING_PUBKEY_PARA = $8009202C
CRYPT_E_OSS_ERROR = $80093000

OSS_MORE_BUF = $80093001
OSS_NEGATIVE_UINTEGER = $80093002
OSS_PDU_RANGE = $80093003
OSS_MORE_INPUT = $80093004
OSS_DATA_ERROR = $80093005
OSS_BAD_ARG = $80093006
OSS_BAD_VERSION = $80093007
OSS_OUT_MEMORY = $80093008
OSS_PDU_MISMATCH = $80093009
OSS_LIMITED = $8009300A
OSS_BAD_PTR = $8009300B
OSS_BAD_TIME = $8009300C
OSS_INDEFINITE_NOT_SUPPORTED = $8009300D
OSS_MEM_ERROR = $8009300E
OSS_BAD_TABLE = $8009300F
OSS_TOO_LONG = $80093010
OSS_CONSTRAINT_VIOLATED = $80093011
OSS_FATAL_ERROR = $80093012
OSS_ACCESS_SERIALIZATION_ERROR = $80093013
OSS_NULL_TBL = $80093014
OSS_NULL_FCN = $80093015
OSS_BAD_ENCRULES = $80093016
OSS_UNAVAIL_ENCRULES = $80093017
OSS_CANT_OPEN_TRACE_WINDOW = $80093018
OSS_UNIMPLEMENTED = $80093019
OSS_OID_DLL_NOT_LINKED = $8009301A
OSS_CANT_OPEN_TRACE_FILE = $8009301B
OSS_TRACE_FILE_ALREADY_OPEN = $8009301C
OSS_TABLE_MISMATCH = $8009301D
OSS_TYPE_NOT_SUPPORTED = $8009301E
OSS_REAL_DLL_NOT_LINKED = $8009301F
OSS_REAL_CODE_NOT_LINKED = $80093020
OSS_OUT_OF_RANGE = $80093021
OSS_COPIER_DLL_NOT_LINKED = $80093022
OSS_CONSTRAINT_DLL_NOT_LINKED = $80093023
OSS_COMPARATOR_DLL_NOT_LINKED = $80093024
OSS_COMPARATOR_CODE_NOT_LINKED = $80093025
OSS_MEM_MGR_DLL_NOT_LINKED = $80093026
OSS_PDV_DLL_NOT_LINKED = $80093027
OSS_PDV_CODE_NOT_LINKED = $80093028
OSS_API_DLL_NOT_LINKED = $80093029
OSS_BERDER_DLL_NOT_LINKED = $8009302A
OSS_PER_DLL_NOT_LINKED = $8009302B
OSS_OPEN_TYPE_ERROR = $8009302C
OSS_MUTEX_NOT_CREATED = $8009302D
OSS_CANT_CLOSE_TRACE_FILE = $8009302E

CRYPT_E_ASN1_ERROR = $80093100
CRYPT_E_ASN1_INTERNAL = $80093101
CRYPT_E_ASN1_EOD = $80093102
CRYPT_E_ASN1_CORRUPT = $80093103
CRYPT_E_ASN1_LARGE = $80093104
CRYPT_E_ASN1_CONSTRAINT = $80093105
CRYPT_E_ASN1_MEMORY = $80093106
CRYPT_E_ASN1_OVERFLOW = $80093107
CRYPT_E_ASN1_BADPDU = $80093108
CRYPT_E_ASN1_BADARGS = $80093109
CRYPT_E_ASN1_BADREAL = $8009310A
CRYPT_E_ASN1_BADTAG = $8009310B
CRYPT_E_ASN1_CHOICE = $8009310C
CRYPT_E_ASN1_RULE = $8009310D
CRYPT_E_ASN1_UTF8 = $8009310E
CRYPT_E_ASN1_PDU_TYPE = $80093133
CRYPT_E_ASN1_NYI = $80093134
CRYPT_E_ASN1_EXTENDED = $80093201
CRYPT_E_ASN1_NOEOD = $80093202

CERTSRV_E_BAD_REQUESTSUBJECT = $80094001
CERTSRV_E_NO_REQUEST = $80094002
CERTSRV_E_BAD_REQUESTSTATUS = $80094003
CERTSRV_E_PROPERTY_EMPTY = $80094004
CERTSRV_E_INVALID_CA_CERTIFICATE = $80094005
CERTSRV_E_SERVER_SUSPENDED = $80094006
CERTSRV_E_ENCODING_LENGTH = $80094007
CERTSRV_E_ROLECONFLICT = $80094008
CERTSRV_E_RESTRICTEDOFFICER = $80094009
CERTSRV_E_KEY_ARCHIVAL_NOT_CONFIGURED = $8009400A
CERTSRV_E_NO_VALID_KRA = $8009400B
CERTSRV_E_BAD_REQUEST_KEY_ARCHIVAL = $8009400C
CERTSRV_E_NO_CAADMIN_DEFINED = $8009400D
CERTSRV_E_BAD_RENEWAL_CERT_ATTRIBUTE = $8009400E
CERTSRV_E_NO_DB_SESSIONS = $8009400F
CERTSRV_E_ALIGNMENT_FAULT = $80094010
CERTSRV_E_ENROLL_DENIED = $80094011
CERTSRV_E_TEMPLATE_DENIED = $80094012
CERTSRV_E_DOWNLEVEL_DC_SSL_OR_UPGRADE = $80094013
CERTSRV_E_UNSUPPORTED_CERT_TYPE = $80094800
CERTSRV_E_NO_CERT_TYPE = $80094801
CERTSRV_E_TEMPLATE_CONFLICT = $80094802
CERTSRV_E_SUBJECT_ALT_NAME_REQUIRED = $80094803
CERTSRV_E_ARCHIVED_KEY_REQUIRED = $80094804
CERTSRV_E_SMIME_REQUIRED = $80094805
CERTSRV_E_BAD_RENEWAL_SUBJECT = $80094806
CERTSRV_E_BAD_TEMPLATE_VERSION = $80094807
CERTSRV_E_TEMPLATE_POLICY_REQUIRED = $80094808
CERTSRV_E_SIGNATURE_POLICY_REQUIRED = $80094809
CERTSRV_E_SIGNATURE_COUNT = $8009480A
CERTSRV_E_SIGNATURE_REJECTED = $8009480B
CERTSRV_E_ISSUANCE_POLICY_REQUIRED = $8009480C
CERTSRV_E_SUBJECT_UPN_REQUIRED = $8009480D
CERTSRV_E_SUBJECT_DIRECTORY_GUID_REQUIRED = $8009480E
CERTSRV_E_SUBJECT_DNS_REQUIRED = $8009480F
CERTSRV_E_ARCHIVED_KEY_UNEXPECTED = $80094810
CERTSRV_E_KEY_LENGTH = $80094811
CERTSRV_E_SUBJECT_EMAIL_REQUIRED = $80094812
CERTSRV_E_UNKNOWN_CERT_TYPE = $80094813
CERTSRV_E_CERT_TYPE_OVERLAP = $80094814

XENROLL_E_KEY_NOT_EXPORTABLE = $80095000
XENROLL_E_CANNOT_ADD_ROOT_CERT = $80095001
XENROLL_E_RESPONSE_KA_HASH_NOT_FOUND = $80095002
XENROLL_E_RESPONSE_UNEXPECTED_KA_HASH = $80095003
XENROLL_E_RESPONSE_KA_HASH_MISMATCH = $80095004
XENROLL_E_KEYSPEC_SMIME_MISMATCH = $80095005

TRUST_E_SYSTEM_ERROR = $80096001
TRUST_E_NO_SIGNER_CERT = $80096002
TRUST_E_COUNTER_SIGNER = $80096003
TRUST_E_CERT_SIGNATURE = $80096004
TRUST_E_TIME_STAMP = $80096005
TRUST_E_BAD_DIGEST = $80096010
TRUST_E_BASIC_CONSTRAINTS = $80096019
TRUST_E_FINANCIAL_CRITERIA = $8009601E

MSSIPOTF_E_OUTOFMEMRANGE = $80097001
MSSIPOTF_E_CANTGETOBJECT = $80097002
MSSIPOTF_E_NOHEADTABLE = $80097003
MSSIPOTF_E_BAD_MAGICNUMBER = $80097004
MSSIPOTF_E_BAD_OFFSET_TABLE = $80097005
MSSIPOTF_E_TABLE_TAGORDER = $80097006
MSSIPOTF_E_TABLE_LONGWORD = $80097007
MSSIPOTF_E_BAD_FIRST_TABLE_PLACEMENT = $80097008
MSSIPOTF_E_TABLES_OVERLAP = $80097009
MSSIPOTF_E_TABLE_PADBYTES = $8009700A
MSSIPOTF_E_FILETOOSMALL = $8009700B
MSSIPOTF_E_TABLE_CHECKSUM = $8009700C
MSSIPOTF_E_FILE_CHECKSUM = $8009700D
MSSIPOTF_E_FAILED_POLICY = $80097010
MSSIPOTF_E_FAILED_HINTS_CHECK = $80097011
MSSIPOTF_E_NOT_OPENTYPE = $80097012
MSSIPOTF_E_FILE = $80097013
MSSIPOTF_E_CRYPT = $80097014
MSSIPOTF_E_BADVERSION = $80097015
MSSIPOTF_E_DSIG_STRUCTURE = $80097016
MSSIPOTF_E_PCONST_CHECK = $80097017
MSSIPOTF_E_STRUCTURE = $80097018

NTE_OP_OK = 0
TRUST_E_PROVIDER_UNKNOWN = $800B0001
TRUST_E_ACTION_UNKNOWN = $800B0002
TRUST_E_SUBJECT_FORM_UNKNOWN = $800B0003
TRUST_E_SUBJECT_NOT_TRUSTED = $800B0004

DIGSIG_E_ENCODE = $800B0005
DIGSIG_E_DECODE = $800B0006
DIGSIG_E_EXTENSIBILITY = $800B0007
DIGSIG_E_CRYPTO = $800B0008

PERSIST_E_SIZEDEFINITE = $800B0009
PERSIST_E_SIZEINDEFINITE = $800B000A
PERSIST_E_NOTSELFSIZING = $800B000B
TRUST_E_NOSIGNATURE = $800B0100

CERT_E_EXPIRED = $800B0101
CERT_E_VALIDITYPERIODNESTING = $800B0102
CERT_E_ROLE = $800B0103
CERT_E_PATHLENCONST = $800B0104
CERT_E_CRITICAL = $800B0105
CERT_E_PURPOSE = $800B0106
CERT_E_ISSUERCHAINING = $800B0107
CERT_E_MALFORMED = $800B0108
CERT_E_UNTRUSTEDROOT = $800B0109
CERT_E_CHAINING = $800B010A
TRUST_E_FAIL = $800B010B
CERT_E_REVOKED = $800B010C
CERT_E_UNTRUSTEDTESTROOT = $800B010D
CERT_E_REVOCATION_FAILURE = $800B010E
CERT_E_CN_NO_MATCH = $800B010F
CERT_E_WRONG_USAGE = $800B0110
TRUST_E_EXPLICIT_DISTRUST = $800B0111
CERT_E_UNTRUSTEDCA = $800B0112
CERT_E_INVALID_POLICY = $800B0113
CERT_E_INVALID_NAME = $800B0114

SPAPI_E_EXPECTED_SECTION_NAME = $800F0000
SPAPI_E_BAD_SECTION_NAME_LINE = $800F0001
SPAPI_E_SECTION_NAME_TOO_LONG = $800F0002
SPAPI_E_GENERAL_SYNTAX = $800F0003
SPAPI_E_WRONG_INF_STYLE = $800F0100
SPAPI_E_SECTION_NOT_FOUND = $800F0101
SPAPI_E_LINE_NOT_FOUND = $800F0102
SPAPI_E_NO_BACKUP = $800F0103
SPAPI_E_NO_ASSOCIATED_CLASS = $800F0200
SPAPI_E_CLASS_MISMATCH = $800F0201
SPAPI_E_DUPLICATE_FOUND = $800F0202
SPAPI_E_NO_DRIVER_SELECTED = $800F0203
SPAPI_E_KEY_DOES_NOT_EXIST = $800F0204
SPAPI_E_INVALID_DEVINST_NAME = $800F0205
SPAPI_E_INVALID_CLASS = $800F0206
SPAPI_E_DEVINST_ALREADY_EXISTS = $800F0207
SPAPI_E_DEVINFO_NOT_REGISTERED = $800F0208
SPAPI_E_INVALID_REG_PROPERTY = $800F0209
SPAPI_E_NO_INF = $800F020A
SPAPI_E_NO_SUCH_DEVINST = $800F020B
SPAPI_E_CANT_LOAD_CLASS_ICON = $800F020C
SPAPI_E_INVALID_CLASS_INSTALLER = $800F020D
SPAPI_E_DI_DO_DEFAULT = $800F020E
SPAPI_E_DI_NOFILECOPY = $800F020F
SPAPI_E_INVALID_HWPROFILE = $800F0210
SPAPI_E_NO_DEVICE_SELECTED = $800F0211
SPAPI_E_DEVINFO_LIST_LOCKED = $800F0212
SPAPI_E_DEVINFO_DATA_LOCKED = $800F0213
SPAPI_E_DI_BAD_PATH = $800F0214
SPAPI_E_NO_CLASSINSTALL_PARAMS = $800F0215
SPAPI_E_FILEQUEUE_LOCKED = $800F0216
SPAPI_E_BAD_SERVICE_INSTALLSECT = $800F0217
SPAPI_E_NO_CLASS_DRIVER_LIST = $800F0218
SPAPI_E_NO_ASSOCIATED_SERVICE = $800F0219
SPAPI_E_NO_DEFAULT_DEVICE_INTERFACE = $800F021A
SPAPI_E_DEVICE_INTERFACE_ACTIVE = $800F021B
SPAPI_E_DEVICE_INTERFACE_REMOVED = $800F021C
SPAPI_E_BAD_INTERFACE_INSTALLSECT = $800F021D
SPAPI_E_NO_SUCH_INTERFACE_CLASS = $800F021E
SPAPI_E_INVALID_REFERENCE_STRING = $800F021F
SPAPI_E_INVALID_MACHINENAME = $800F0220
SPAPI_E_REMOTE_COMM_FAILURE = $800F0221
SPAPI_E_MACHINE_UNAVAILABLE = $800F0222
SPAPI_E_NO_CONFIGMGR_SERVICES = $800F0223
SPAPI_E_INVALID_PROPPAGE_PROVIDER = $800F0224
SPAPI_E_NO_SUCH_DEVICE_INTERFACE = $800F0225
SPAPI_E_DI_POSTPROCESSING_REQUIRED = $800F0226
SPAPI_E_INVALID_COINSTALLER = $800F0227
SPAPI_E_NO_COMPAT_DRIVERS = $800F0228
SPAPI_E_NO_DEVICE_ICON = $800F0229
SPAPI_E_INVALID_INF_LOGCONFIG = $800F022A
SPAPI_E_DI_DONT_INSTALL = $800F022B
SPAPI_E_INVALID_FILTER_DRIVER = $800F022C
SPAPI_E_NON_WINDOWS_NT_DRIVER = $800F022D
SPAPI_E_NON_WINDOWS_DRIVER = $800F022E
SPAPI_E_NO_CATALOG_FOR_OEM_INF = $800F022F
SPAPI_E_DEVINSTALL_QUEUE_NONNATIVE = $800F0230
SPAPI_E_NOT_DISABLEABLE = $800F0231
SPAPI_E_CANT_REMOVE_DEVINST = $800F0232
SPAPI_E_INVALID_TARGET = $800F0233
SPAPI_E_DRIVER_NONNATIVE = $800F0234
SPAPI_E_IN_WOW64 = $800F0235
SPAPI_E_SET_SYSTEM_RESTORE_POINT = $800F0236
SPAPI_E_INCORRECTLY_COPIED_INF = $800F0237
SPAPI_E_SCE_DISABLED = $800F0238
SPAPI_E_UNKNOWN_EXCEPTION = $800F0239
SPAPI_E_PNP_REGISTRY_ERROR = $800F023A
SPAPI_E_REMOTE_REQUEST_UNSUPPORTED = $800F023B
SPAPI_E_NOT_AN_INSTALLED_OEM_INF = $800F023C
SPAPI_E_INF_IN_USE_BY_DEVICES = $800F023D
SPAPI_E_DI_FUNCTION_OBSOLETE = $800F023E
SPAPI_E_NO_AUTHENTICODE_CATALOG = $800F023F
SPAPI_E_AUTHENTICODE_DISALLOWED = $800F0240
SPAPI_E_AUTHENTICODE_TRUSTED_PUBLISHER = $800F0241
SPAPI_E_AUTHENTICODE_TRUST_NOT_ESTABLISHED = $800F0242
SPAPI_E_AUTHENTICODE_PUBLISHER_NOT_TRUSTED = $800F0243
SPAPI_E_SIGNATURE_OSATTRIBUTE_MISMATCH = $800F0244
SPAPI_E_ONLY_VALIDATE_VIA_AUTHENTICODE = $800F0245
SPAPI_E_UNRECOVERABLE_STACK_OVERFLOW = $800F0300
SPAPI_E_ERROR_NOT_INSTALLED = $800F1000

SCARD_S_SUCCESS = NO_ERROR
SCARD_F_INTERNAL_ERROR = $80100001
SCARD_E_CANCELLED = $80100002
SCARD_E_INVALID_HANDLE = $80100003
SCARD_E_INVALID_PARAMETER = $80100004
SCARD_E_INVALID_TARGET = $80100005
SCARD_E_NO_MEMORY = $80100006
SCARD_F_WAITED_TOO_LONG = $80100007
SCARD_E_INSUFFICIENT_BUFFER = $80100008
SCARD_E_UNKNOWN_READER = $80100009
SCARD_E_TIMEOUT = $8010000A
SCARD_E_SHARING_VIOLATION = $8010000B
SCARD_E_NO_SMARTCARD = $8010000C
SCARD_E_UNKNOWN_CARD = $8010000D
SCARD_E_CANT_DISPOSE = $8010000E
SCARD_E_PROTO_MISMATCH = $8010000F
SCARD_E_NOT_READY = $80100010
SCARD_E_INVALID_VALUE = $80100011
SCARD_E_SYSTEM_CANCELLED  = $80100012
SCARD_F_COMM_ERROR = $80100013
SCARD_F_UNKNOWN_ERROR = $80100014
SCARD_E_INVALID_ATR = $80100015
SCARD_E_NOT_TRANSACTED = $80100016
SCARD_E_READER_UNAVAILABLE = $80100017
SCARD_P_SHUTDOWN = $80100018
SCARD_E_PCI_TOO_SMALL = $80100019
SCARD_E_READER_UNSUPPORTED = $8010001A
SCARD_E_DUPLICATE_READER = $8010001B
SCARD_E_CARD_UNSUPPORTED = $8010001C
SCARD_E_NO_SERVICE = $8010001D
SCARD_E_SERVICE_STOPPED = $8010001E
SCARD_E_UNEXPECTED = $8010001F
SCARD_E_ICC_INSTALLATION = $80100020
SCARD_E_ICC_CREATEORDER = $80100021
SCARD_E_UNSUPPORTED_FEATURE = $80100022
SCARD_E_DIR_NOT_FOUND = $80100023
SCARD_E_FILE_NOT_FOUND = $80100024
SCARD_E_NO_DIR = $80100025
SCARD_E_NO_FILE = $80100026
SCARD_E_NO_ACCESS = $80100027
SCARD_E_WRITE_TOO_MANY = $80100028
SCARD_E_BAD_SEEK = $80100029
SCARD_E_INVALID_CHV = $8010002A
SCARD_E_UNKNOWN_RES_MNG = $8010002B
SCARD_E_NO_SUCH_CERTIFICATE = $8010002C
SCARD_E_CERTIFICATE_UNAVAILABLE = $8010002D
SCARD_E_NO_READERS_AVAILABLE = $8010002E
SCARD_E_COMM_DATA_LOST = $8010002F
SCARD_E_NO_KEY_CONTAINER = $80100030
SCARD_E_SERVER_TOO_BUSY = $80100031
SCARD_W_UNSUPPORTED_CARD = $80100065
SCARD_W_UNRESPONSIVE_CARD = $80100066
SCARD_W_UNPOWERED_CARD = $80100067
SCARD_W_RESET_CARD = $80100068
SCARD_W_REMOVED_CARD = $80100069
SCARD_W_SECURITY_VIOLATION = $8010006A
SCARD_W_WRONG_CHV = $8010006B
SCARD_W_CHV_BLOCKED = $8010006C
SCARD_W_EOF= $8010006D
SCARD_W_CANCELLED_BY_USER = $8010006E
SCARD_W_CARD_NOT_AUTHENTICATED = $8010006F

COMADMIN_E_OBJECTERRORS = $80110401
COMADMIN_E_OBJECTINVALID = $80110402
COMADMIN_E_KEYMISSING = $80110403
COMADMIN_E_ALREADYINSTALLED = $80110404
COMADMIN_E_APP_FILE_WRITEFAIL = $80110407
COMADMIN_E_APP_FILE_READFAIL = $80110408
COMADMIN_E_APP_FILE_VERSION = $80110409
COMADMIN_E_BADPATH = $8011040A
COMADMIN_E_APPLICATIONEXISTS = $8011040B
COMADMIN_E_ROLEEXISTS = $8011040C
COMADMIN_E_CANTCOPYFILE = $8011040D
COMADMIN_E_NOUSER = $8011040F
COMADMIN_E_INVALIDUSERIDS = $80110410
COMADMIN_E_NOREGISTRYCLSID = $80110411
COMADMIN_E_BADREGISTRYPROGID = $80110412
COMADMIN_E_AUTHENTICATIONLEVEL = $80110413
COMADMIN_E_USERPASSWDNOTVALID = $80110414
COMADMIN_E_CLSIDORIIDMISMATCH = $80110418
COMADMIN_E_REMOTEINTERFACE = $80110419
COMADMIN_E_DLLREGISTERSERVER = $8011041A
COMADMIN_E_NOSERVERSHARE = $8011041B
COMADMIN_E_DLLLOADFAILED = $8011041D
COMADMIN_E_BADREGISTRYLIBID = $8011041E
COMADMIN_E_APPDIRNOTFOUND = $8011041F
COMADMIN_E_REGISTRARFAILED = $80110423
COMADMIN_E_COMPFILE_DOESNOTEXIST = $80110424
COMADMIN_E_COMPFILE_LOADDLLFAIL = $80110425
COMADMIN_E_COMPFILE_GETCLASSOBJ = $80110426
COMADMIN_E_COMPFILE_CLASSNOTAVAIL = $80110427
COMADMIN_E_COMPFILE_BADTLB = $80110428
COMADMIN_E_COMPFILE_NOTINSTALLABLE = $80110429
COMADMIN_E_NOTCHANGEABLE = $8011042A
COMADMIN_E_NOTDELETEABLE = $8011042B
COMADMIN_E_SESSION = $8011042C
COMADMIN_E_COMP_MOVE_LOCKED = $8011042D
COMADMIN_E_COMP_MOVE_BAD_DEST = $8011042E
COMADMIN_E_REGISTERTLB = $80110430
COMADMIN_E_SYSTEMAPP = $80110433
COMADMIN_E_COMPFILE_NOREGISTRAR = $80110434
COMADMIN_E_COREQCOMPINSTALLED = $80110435
COMADMIN_E_SERVICENOTINSTALLED = $80110436
COMADMIN_E_PROPERTYSAVEFAILED = $80110437
COMADMIN_E_OBJECTEXISTS = $80110438
COMADMIN_E_COMPONENTEXISTS = $80110439
COMADMIN_E_REGFILE_CORRUPT = $8011043B
COMADMIN_E_PROPERTY_OVERFLOW = $8011043C
COMADMIN_E_NOTINREGISTRY = $8011043E
COMADMIN_E_OBJECTNOTPOOLABLE = $8011043F
COMADMIN_E_APPLID_MATCHES_CLSID = $80110446
COMADMIN_E_ROLE_DOES_NOT_EXIST = $80110447
COMADMIN_E_START_APP_NEEDS_COMPONENTS = $80110448
COMADMIN_E_REQUIRES_DIFFERENT_PLATFORM = $80110449
COMADMIN_E_CAN_NOT_EXPORT_APP_PROXY = $8011044A
COMADMIN_E_CAN_NOT_START_APP = $8011044B
COMADMIN_E_CAN_NOT_EXPORT_SYS_APP = $8011044C
COMADMIN_E_CANT_SUBSCRIBE_TO_COMPONENT = $8011044D
COMADMIN_E_EVENTCLASS_CANT_BE_SUBSCRIBER = $8011044E
COMADMIN_E_LIB_APP_PROXY_INCOMPATIBLE = $8011044F
COMADMIN_E_BASE_PARTITION_ONLY = $80110450
COMADMIN_E_START_APP_DISABLED = $80110451
COMADMIN_E_CAT_DUPLICATE_PARTITION_NAME = $80110457
COMADMIN_E_CAT_INVALID_PARTITION_NAME = $80110458
COMADMIN_E_CAT_PARTITION_IN_USE  = $80110459
COMADMIN_E_FILE_PARTITION_DUPLICATE_FILES = $8011045A
COMADMIN_E_CAT_IMPORTED_COMPONENTS_NOT_ALLOWED = $8011045B
COMADMIN_E_AMBIGUOUS_APPLICATION_NAME = $8011045C
COMADMIN_E_AMBIGUOUS_PARTITION_NAME = $8011045D
COMADMIN_E_REGDB_NOTINITIALIZED = $80110472
COMADMIN_E_REGDB_NOTOPEN = $80110473
COMADMIN_E_REGDB_SYSTEMERR = $80110474
COMADMIN_E_REGDB_ALREADYRUNNING = $80110475
COMADMIN_E_MIG_VERSIONNOTSUPPORTED = $80110480
COMADMIN_E_MIG_SCHEMANOTFOUND = $80110481
COMADMIN_E_CAT_BITNESSMISMATCH = $80110482
COMADMIN_E_CAT_UNACCEPTABLEBITNESS = $80110483
COMADMIN_E_CAT_WRONGAPPBITNESS = $80110484
COMADMIN_E_CAT_PAUSE_RESUME_NOT_SUPPORTED = $80110485
COMADMIN_E_CAT_SERVERFAULT = $80110486

COMQC_E_APPLICATION_NOT_QUEUED = $80110600
COMQC_E_NO_QUEUEABLE_INTERFACES = $80110601
COMQC_E_QUEUING_SERVICE_NOT_AVAILABLE = $80110602
COMQC_E_NO_IPERSISTSTREAM = $80110603
COMQC_E_BAD_MESSAGE = $80110604
COMQC_E_UNAUTHENTICATED = $80110605
COMQC_E_UNTRUSTED_ENQUEUER = $80110606

MSDTC_E_DUPLICATE_RESOURCE = $80110701

COMADMIN_E_OBJECT_PARENT_MISSING = $80110808
COMADMIN_E_OBJECT_DOES_NOT_EXIST = $80110809
COMADMIN_E_APP_NOT_RUNNING = $8011080A
COMADMIN_E_INVALID_PARTITION = $8011080B
COMADMIN_E_SVCAPP_NOT_POOLABLE_OR_RECYCLABLE = $8011080D
COMADMIN_E_USER_IN_SET = $8011080E
COMADMIN_E_CANTRECYCLELIBRARYAPPS = $8011080F
COMADMIN_E_CANTRECYCLESERVICEAPPS = $80110811
COMADMIN_E_PROCESSALREADYRECYCLED = $80110812
COMADMIN_E_PAUSEDPROCESSMAYNOTBERECYCLED = $80110813
COMADMIN_E_CANTMAKEINPROCSERVICE = $80110814
COMADMIN_E_PROGIDINUSEBYCLSID = $80110815
COMADMIN_E_DEFAULT_PARTITION_NOT_IN_SET = $80110816
COMADMIN_E_RECYCLEDPROCESSMAYNOTBEPAUSED = $80110817
COMADMIN_E_PARTITION_ACCESSDENIED = $80110818
COMADMIN_E_PARTITION_MSI_ONLY = $80110819
COMADMIN_E_LEGACYCOMPS_NOT_ALLOWED_IN_1_0_FORMAT = $8011081A
COMADMIN_E_LEGACYCOMPS_NOT_ALLOWED_IN_NONBASE_PARTITIONS = $8011081B
COMADMIN_E_COMP_MOVE_SOURCE = $8011081C
COMADMIN_E_COMP_MOVE_DEST = $8011081D
COMADMIN_E_COMP_MOVE_PRIVATE = $8011081E
COMADMIN_E_BASEPARTITION_REQUIRED_IN_SET = $8011081F
COMADMIN_E_CANNOT_ALIAS_EVENTCLASS = $80110820
COMADMIN_E_PRIVATE_ACCESSDENIED = $80110821
COMADMIN_E_SAFERINVALID = $80110822
COMADMIN_E_REGISTRY_ACCESSDENIED = $80110823
COMADMIN_E_PARTITIONS_DISABLED = $80110824

;windef.h -- Basic Windows Type Definitions
;Copyright (c) Microsoft Corporation. All rights reserved.

MAX_PATH = 260
NULL = 0
FALSE = 0
TRUE = 1

;winver.h -    Version management functions, types, and definitions          *
VS_FILE_INFO = RT_VERSION
VS_VERSION_INFO = 1
VS_USER_DEFINED = $100
VS_FFI_SIGNATURE = $BD04EFFE
VS_FFI_STRUCVERSION = $10000
VS_FFI_FILEFLAGSMASK = $3F
VS_FF_DEBUG = 1
VS_FF_PRERELEASE = 2
VS_FF_PATCHED = 4
VS_FF_PRIVATEBUILD = 8
VS_FF_INFOINFERRED = $10
VS_FF_SPECIALBUILD = $20

VOS_UNKNOWN = 0
VOS_DOS = $10000
VOS_OS216 = $20000
VOS_OS232 = $30000
VOS_NT = $40000
VOS_WINCE = $50000
VOS__BASE = 0
VOS__WINDOWS16 = 1
VOS__PM16 = 2
VOS__PM32 = 3
VOS__WINDOWS32 = 4
VOS_DOS_WINDOWS16 = $10001
VOS_DOS_WINDOWS32 = $10004
VOS_OS216_PM16 = $20002
VOS_OS232_PM32 = $30003
VOS_NT_WINDOWS32 = $40004

VFT_UNKNOWN = 0
VFT_APP = 1
VFT_DLL = 2
VFT_DRV = 3
VFT_FONT = 4
VFT_VXD = 5
VFT_STATIC_LIB = 7

VFT2_UNKNOWN = 0
VFT2_DRV_PRINTER = 1
VFT2_DRV_KEYBOARD = 2
VFT2_DRV_LANGUAGE = 3
VFT2_DRV_DISPLAY = 4
VFT2_DRV_MOUSE = 5
VFT2_DRV_NETWORK = 6
VFT2_DRV_SYSTEM = 7
VFT2_DRV_INSTALLABLE = 8
VFT2_DRV_SOUND = 9
VFT2_DRV_COMM = $A
VFT2_DRV_INPUTMETHOD = $B
VFT2_DRV_VERSIONED_PRINTER = $C
VFT2_FONT_RASTER = 1
VFT2_FONT_VECTOR = 2
VFT2_FONT_TRUETYPE = 3

VFFF_ISSHAREDFILE = 1

VFF_CURNEDEST = 1
VFF_FILEINUSE = 2
VFF_BUFFTOOSMALL = 4

VIFF_FORCEINSTALL = 1
VIFF_DONTDELETEOLD = 2

VIF_TEMPFILE = 1
VIF_MISMATCH = 2
VIF_SRCOLD = 4
VIF_DIFFLANG = 8
VIF_DIFFCODEPG = $10
VIF_DIFFTYPE = $20

VIF_WRITEPROT = $40
VIF_FILEINUSE = $80
VIF_OUTOFSPACE = $100
VIF_ACCESSVIOLATION = $200
VIF_SHARINGVIOLATION = $400
VIF_CANNOTCREATE = $800
VIF_CANNOTDELETE = $1000
VIF_CANNOTRENAME = $2000
VIF_CANNOTDELETECUR = $4000
VIF_OUTOFMEMORY = $8000
VIF_CANNOTREADSRC = $10000
VIF_CANNOTREADDST = $20000
VIF_BUFFTOOSMALL = $40000
VIF_CANNOTLOADLZ32 = $80000
VIF_CANNOTLOADCABINET = $100000

;<<<<>>>> winnt.h <<<<>>>>
MAX_NATURAL_ALIGNMENT  = 4
MEMORY_ALLOCATION_ALIGNMENT = 8
ANYSIZE_ARRAY = 1
APPLICATION_ERROR_MASK = $20000000
ERROR_SEVERITY_SUCCESS = 0
ERROR_SEVERITY_INFORMATIONAL = $40000000
ERROR_SEVERITY_WARNING = $80000000
ERROR_SEVERITY_ERROR = $C0000000

MAXLONGLONG = $7fffffffffffffff

ANSI_NULL = 0
UNICODE_NULL = 0
UNICODE_STRING_MAX_BYTES = 65534
UNICODE_STRING_MAX_CHARS = 32767

WPF_SETMINPOSITION = 1
WPF_RESTORETOMAXIMIZED = 2
WPF_ASYNCWINDOWPLACEMENT = 4

MINCHAR = $80
MAXCHAR = $7f
MINSHORT = $8000
MAXSHORT = $7fff
MINLONG = $80000000
MAXLONG = $7fffffff
MAXBYTE = $ff
MAXWORD = $ffff
MAXDWORD = $ffffffff

struct LEGACYSAVEAREA
       ControlWord dw ?
       Reserved0 dw ?
       StatusWord dw ?
       Reserved1 dw ?
       TagWord dw ?
       Reserved2 dw ?
       ErrorOffset dd ?
       ErrorSelector dw ?
       ErrorOpcode dw ?
       DataOffset dd ?
       DataSelector dw ?
       Reserved3 dw ?
       FloatRegisters db 8*10 dup(?)
ends

MINCHAR = $80
MAXCHAR = $7f
MINSHORT = $8000
MAXSHORT = $7fff
MINLONG = $80000000
MAXLONG = $7fffffff
MAXBYTE = $ff
MAXWORD = $ffff
MAXDWORD = $ffffffff

VER_SERVER_NT = $80000000
VER_WORKSTATION_NT = $40000000
VER_SUITE_SMALLBUSINESS = 1
VER_SUITE_ENTERPRISE = 2
VER_SUITE_BACKOFFICE = 4
VER_SUITE_COMMUNICATIONS = 8
VER_SUITE_TERMINAL = $10
VER_SUITE_SMALLBUSINESS_RESTRICTED = $20
VER_SUITE_EMBEDDEDNT = $40
VER_SUITE_DATACENTER = $80
VER_SUITE_SINGLEUSERTS = $100
VER_SUITE_PERSONAL = $200
VER_SUITE_BLADE = $400
VER_SUITE_EMBEDDED_RESTRICTED = $800
VER_SUITE_SECURITY_APPLIANCE = $1000
VER_SUITE_STORAGE_SERVER = $2000
VER_SUITE_COMPUTE_SERVER = $4000

LANG_NEUTRAL = 0
LANG_INVARIANT = $7f
LANG_AFRIKAANS = $36
LANG_ALBANIAN = $1c
LANG_ARABIC = 1
LANG_ARMENIAN = $2b
LANG_ASSAMESE = $4d
LANG_AZERI = $2c
LANG_BASQUE = $2d
LANG_BELARUSIAN = $23
LANG_BENGALI = $45
LANG_BULGARIAN = 2
LANG_CATALAN = 3
LANG_CHINESE = 4
LANG_CROATIAN = $1a
LANG_CZECH = 5
LANG_DANISH = 6
LANG_DIVEHI = $65
LANG_DUTCH = $13
LANG_ENGLISH = 9
LANG_ESTONIAN = $25
LANG_FAEROESE = $38
LANG_FARSI = $29
LANG_FINNISH = $b
LANG_FRENCH = $c
LANG_GALICIAN = $56
LANG_GEORGIAN = $37
LANG_GERMAN = 7
LANG_GREEK = 8
LANG_GUJARATI = $47
LANG_HEBREW = $d
LANG_HINDI = $39
LANG_HUNGARIAN = $e
LANG_ICELANDIC = $f
LANG_INDONESIAN = $21
LANG_ITALIAN = $10
LANG_JAPANESE = $11
LANG_KANNADA = $4b
LANG_KASHMIRI = $60
LANG_KAZAK = $3f
LANG_KONKANI = $57
LANG_KOREAN = $12
LANG_KYRGYZ = $40
LANG_LATVIAN = $26
LANG_LITHUANIAN = $27
LANG_MACEDONIAN = $2f
LANG_MALAY = $3e
LANG_MALAYALAM = $4c
LANG_MANIPURI = $58
LANG_MARATHI = $4e
LANG_MONGOLIAN = $50
LANG_NEPALI = $61
LANG_NORWEGIAN = $14
LANG_ORIYA = $48
LANG_POLISH = $15
LANG_PORTUGUESE = $16
LANG_PUNJABI = $46
LANG_ROMANIAN = $18
LANG_RUSSIAN = $19
LANG_SANSKRIT = $4f
LANG_SERBIAN = $1a
LANG_SINDHI = $59
LANG_SLOVAK = $1b
LANG_SLOVENIAN = $24
LANG_SPANISH = $a
LANG_SWAHILI = $41
LANG_SWEDISH = $1d
LANG_SYRIAC = $5a
LANG_TAMIL = $49
LANG_TATAR = $44
LANG_TELUGU = $4a
LANG_THAI = $1e
LANG_TURKISH = $1f
LANG_UKRAINIAN = $22
LANG_URDU = $20
LANG_UZBEK = $43
LANG_VIETNAMESE = $2a

;Sublanguage IDs.
SUBLANG_NEUTRAL = 0
SUBLANG_DEFAULT = 1
SUBLANG_SYS_DEFAULT = 2
SUBLANG_ARABIC_SAUDI_ARABIA = 1
SUBLANG_ARABIC_IRAQ = 2
SUBLANG_ARABIC_EGYPT = 3
SUBLANG_ARABIC_LIBYA = 4
SUBLANG_ARABIC_ALGERIA = 5
SUBLANG_ARABIC_MOROCCO = 6
SUBLANG_ARABIC_TUNISIA = 7
SUBLANG_ARABIC_OMAN = 8
SUBLANG_ARABIC_YEMEN = 9
SUBLANG_ARABIC_SYRIA = $a
SUBLANG_ARABIC_JORDAN = $b
SUBLANG_ARABIC_LEBANON = $c
SUBLANG_ARABIC_KUWAIT = $d
SUBLANG_ARABIC_UAE = $e
SUBLANG_ARABIC_BAHRAIN = $f
SUBLANG_ARABIC_QATAR = $10
SUBLANG_AZERI_LATIN = 1
SUBLANG_AZERI_CYRILLIC = 2
SUBLANG_CHINESE_TRADITIONAL = 1
SUBLANG_CHINESE_SIMPLIFIED = 2
SUBLANG_CHINESE_HONGKONG = 3
SUBLANG_CHINESE_SINGAPORE = 4
SUBLANG_CHINESE_MACAU = 5
SUBLANG_DUTCH = 1
SUBLANG_DUTCH_BELGIAN = 2
SUBLANG_ENGLISH_US = 1
SUBLANG_ENGLISH_UK = 2
SUBLANG_ENGLISH_AUS = 3
SUBLANG_ENGLISH_CAN = 4
SUBLANG_ENGLISH_NZ = 5
SUBLANG_ENGLISH_EIRE = 6
SUBLANG_ENGLISH_SOUTH_AFRICA = 7
SUBLANG_ENGLISH_JAMAICA = 8
SUBLANG_ENGLISH_CARIBBEAN = 9
SUBLANG_ENGLISH_BELIZE = $a
SUBLANG_ENGLISH_TRINIDAD = $b
SUBLANG_ENGLISH_ZIMBABWE = $c
SUBLANG_ENGLISH_PHILIPPINES = $d
SUBLANG_FRENCH = 1
SUBLANG_FRENCH_BELGIAN = 2
SUBLANG_FRENCH_CANADIAN = 3
SUBLANG_FRENCH_SWISS = 4
SUBLANG_FRENCH_LUXEMBOURG = 5
SUBLANG_FRENCH_MONACO = 6
SUBLANG_GERMAN = 1
SUBLANG_GERMAN_SWISS = 2
SUBLANG_GERMAN_AUSTRIAN = 3
SUBLANG_GERMAN_LUXEMBOURG = 4
SUBLANG_GERMAN_LIECHTENSTEIN = 5
SUBLANG_ITALIAN = 1
SUBLANG_ITALIAN_SWISS = 2
SUBLANG_KASHMIRI_SASIA = 2
SUBLANG_KASHMIRI_INDIA = 2
SUBLANG_KOREAN = 1
SUBLANG_LITHUANIAN = 1
SUBLANG_MALAY_MALAYSIA = 1
SUBLANG_MALAY_BRUNEI_DARUSSALAM = 2
SUBLANG_NEPALI_INDIA = 2
SUBLANG_NORWEGIAN_BOKMAL = 1
SUBLANG_NORWEGIAN_NYNORSK = 2
SUBLANG_PORTUGUESE = 2
SUBLANG_PORTUGUESE_BRAZILIAN = 1
SUBLANG_SERBIAN_LATIN = 2
SUBLANG_SERBIAN_CYRILLIC = 3
SUBLANG_SPANISH = 1
SUBLANG_SPANISH_MEXICAN = 2
SUBLANG_SPANISH_MODERN = 3
SUBLANG_SPANISH_GUATEMALA = 4
SUBLANG_SPANISH_COSTA_RICA = 5
SUBLANG_SPANISH_PANAMA = 6
SUBLANG_SPANISH_DOMINICAN_REPUBLIC = 7
SUBLANG_SPANISH_VENEZUELA = 8
SUBLANG_SPANISH_COLOMBIA = 9
SUBLANG_SPANISH_PERU = $a
SUBLANG_SPANISH_ARGENTINA = $b
SUBLANG_SPANISH_ECUADOR = $c
SUBLANG_SPANISH_CHILE = $d
SUBLANG_SPANISH_URUGUAY = $e
SUBLANG_SPANISH_PARAGUAY = $f
SUBLANG_SPANISH_BOLIVIA = $10
SUBLANG_SPANISH_EL_SALVADOR = $11
SUBLANG_SPANISH_HONDURAS = $12
SUBLANG_SPANISH_NICARAGUA = $13
SUBLANG_SPANISH_PUERTO_RICO = $14
SUBLANG_SWEDISH = 1    ;Swedish
SUBLANG_SWEDISH_FINLAND = 2
SUBLANG_URDU_PAKISTAN = 1
SUBLANG_URDU_INDIA = 2
SUBLANG_UZBEK_LATIN = 1
SUBLANG_UZBEK_CYRILLIC = 2

; Sorting IDs.
SORT_DEFAULT = 0
SORT_JAPANESE_XJIS = 0
SORT_JAPANESE_UNICODE = 1
SORT_CHINESE_BIG5 = 0
SORT_CHINESE_PRCP = 0
SORT_CHINESE_UNICODE = 1
SORT_CHINESE_PRC = 2
SORT_CHINESE_BOPOMOFO = 3
SORT_KOREAN_KSC = 0
SORT_KOREAN_UNICODE = 1
SORT_GERMAN_PHONE_BOOK = 1
SORT_HUNGARIAN_DEFAULT = 0
SORT_HUNGARIAN_TECHNICAL = 1
SORT_GEORGIAN_TRADITIONAL = 0
SORT_GEORGIAN_MODERN = 1

LANG_SYSTEM_DEFAULT = $800
LANG_USER_DEFAULT = $400
LOCALE_SYSTEM_DEFAULT = $800
LOCALE_USER_DEFAULT = $400
LOCALE_NEUTRAL = 0
LOCALE_INVARIANT = $7f

NLS_VALID_LOCALE_MASK = $fffff

STATUS_WAIT_0 = 0
STATUS_ABANDONED_WAIT_0 = $80
STATUS_USER_APC = $C0
STATUS_TIMEOUT = $102
STATUS_PENDING = $103
DBG_EXCEPTION_HANDLED = $10001
DBG_CONTINUE = $10002
STATUS_SEGMENT_NOTIFICATION = $40000005
DBG_TERMINATE_THREAD = $40010003
DBG_TERMINATE_PROCESS = $40010004
DBG_CONTROL_C = $40010005
DBG_CONTROL_BREAK = $40010008
DBG_COMMAND_EXCEPTION = $40010009
STATUS_GUARD_PAGE_VIOLATION = $80000001
STATUS_DATATYPE_MISALIGNMENT = $80000002
STATUS_BREAKPOINT = $80000003
STATUS_SINGLE_STEP = $80000004
DBG_EXCEPTION_NOT_HANDLED = $80010001
STATUS_ACCESS_VIOLATION = $C0000005
STATUS_IN_PAGE_ERROR = $C0000006
STATUS_INVALID_HANDLE = $C0000008
STATUS_NO_MEMORY = $C0000017
STATUS_ILLEGAL_INSTRUCTION = $C000001D
STATUS_NONCONTINUABLE_EXCEPTION = $C0000025
STATUS_INVALID_DISPOSITION = $C0000026
STATUS_ARRAY_BOUNDS_EXCEEDED = $C000008C
STATUS_FLOAT_DENORMAL_OPERAND = $C000008D
STATUS_FLOAT_DIVIDE_BY_ZERO = $C000008E
STATUS_FLOAT_INEXACT_RESULT = $C000008F
STATUS_FLOAT_INVALID_OPERATION = $C0000090
STATUS_FLOAT_OVERFLOW = $C0000091
STATUS_FLOAT_STACK_CHECK = $C0000092
STATUS_FLOAT_UNDERFLOW = $C0000093
STATUS_INTEGER_DIVIDE_BY_ZERO = $C0000094
STATUS_INTEGER_OVERFLOW = $C0000095
STATUS_PRIVILEGED_INSTRUCTION = $C0000096
STATUS_STACK_OVERFLOW = $C00000FD
STATUS_CONTROL_C_EXIT = $C000013A
STATUS_FLOAT_MULTIPLE_FAULTS = $C00002B4
STATUS_FLOAT_MULTIPLE_TRAPS = $C00002B5
STATUS_REG_NAT_CONSUMPTION = $C00002C9
STATUS_SXS_EARLY_DEACTIVATION = $C015000F
STATUS_SXS_INVALID_DEACTIVATION = $C0150010

MAXIMUM_WAIT_OBJECTS = 64
MAXIMUM_SUSPEND_COUNT = MAXCHAR

_MM_HINT_T0 = 1
_MM_HINT_T1 = 2
_MM_HINT_T2 = 3
_MM_HINT_NTA = 0

CONTEXT_AMD64 = $100000
CONTEXT_CONTROL = CONTEXT_AMD64 or $1
CONTEXT_INTEGER = CONTEXT_AMD64 or $2
CONTEXT_SEGMENTS = CONTEXT_AMD64 or $4
CONTEXT_FLOATING_POINT = CONTEXT_AMD64 or $8
CONTEXT_DEBUG_REGISTERS = CONTEXT_AMD64 or $10
CONTEXT_FULL = CONTEXT_CONTROL or CONTEXT_INTEGER or CONTEXT_FLOATING_POINT
CONTEXT_ALL = CONTEXT_CONTROL or CONTEXT_INTEGER or CONTEXT_SEGMENTS or\
	      CONTEXT_FLOATING_POINT or CONTEXT_DEBUG_REGISTERS

INITIAL_MXCSR = $1f80
INITIAL_FPCSR = $27f

struct LUIDANDATTRIBUTES
       Luid LUID
       Attributes dd ?
ends

struct M128A
       Low dq ?
       High dq ?
ends

struct XMMSAVEAREA64
       ControlWord dw ?
       StatusWord dw ?
       TagWord db ?
       Reserved1 db ?
       ErrorOpcode dw ?
       ErrorOffset dd ?
       ErrorSelector dw ?
       Reserved2 dw ?
       DataOffset dd ?
       DataSelector dw ?
       Reserved3 dw ?
       MxCsr dd ?
       MxCsr_Mask dd ?
       FloatRegisters db 8*sizeof.M128A dup(?)
       XmmRegisters db 16*sizeof.M128A dup(?)
       Reserved4 db 96 dup(?)
ends

struct CONTEXT64
       P1Home dq ?
       P2Home dq ?
       P3Home dq ?
       P4Home dq ?
       P5Home dq ?
       P6Home dq ?
       ContextFlags dd ?
       MxCsr dd ?
       SegCs dw ?
       SegDs dw ?
       SegEs dw ?
       SegFs dw ?
       SegGs dw ?
       SegSs dw ?
       EFlags dd ?
       Dr0 dq ?
       Dr1 dq ?
       Dr2 dq ?
       Dr3 dq ?
       Dr6 dq ?
       Dr7 dq ?
       Rax dq ?
       Rcx dq ?
       Rdx dq ?
       Rbx dq ?
       Rsp dq ?
       Rbp dq ?
       Rsi dq ?
       Rdi dq ?
       R8 dq ?
       R9 dq ?
       R10 dq ?
       R11 dq ?
       R12 dq ?
       R13 dq ?
       R14 dq ?
       R15 dq ?
       Rip dq ?
       union
	   FltSave XMMSAVEAREA64
	   struct
	       Header db 2*sizeof.M128A dup(?)
	       Legacy db 8*sizeof.M128A dup(?)
	       Xmm0 M128A
	       Xmm1 M128A
	       Xmm2 M128A
	       Xmm3 M128A
	       Xmm4 M128A
	       Xmm5 M128A
	       Xmm6 M128A
	       Xmm7 M128A
	       Xmm8 M128A
	       Xmm9 M128A
	       Xmm10 M128A
	       Xmm11 M128A
	       Xmm12 M128A
	       Xmm13 M128A
	       Xmm14 M128A
	       Xmm15 M128A
	   ends
       ends
       VectorRegister db 26*sizeof.M128A dup(?)
       VectorControl dq ?
       DebugControl dq ?
       LastBranchToRip dq ?
       LastBranchFromRip dq ?
       LastExceptionToRip dq ?
       LastExceptionFromRip dq ?
ends

struct	CONTEXT64EXT
; N.B. the context should be aligned 40h for new extended context. If not then InitializeContext aligns it and returns aligned begin of the structure. This is the reason of adding extra padding bytes at the end of structure.
; Register parameter home addresses.
; N.B. These fields are for convience - they could be used to extend the context record in the future.
	P1Home			rq	1
	P2Home			rq	1
	P3Home			rq	1
	P4Home			rq	1
	P5Home			rq	1
	P6Home			rq	1
; Control flags. Offset 30h
	ContextFlags		rd	1
	MxCsr			rd	1
; Segment Registers and processor flags.
	SegCs			rw	1
	SegDs			rw	1
	SegEs			rw	1
	SegFs			rw	1
	SegGs			rw	1
	SegSs			rw	1
	EFlags			rd	1
; Debug registers. Offset 48h
	Dr0			rq	1
	Dr1			rq	1
	Dr2			rq	1
	Dr3			rq	1
	Dr6			rq	1
	Dr7			rq	1
; Integer registers. Offset 78h
	Rax			rq	1
	Rcx			rq	1
	Rdx			rq	1
	Rbx			rq	1
	Rsp			rq	1
	Rbp			rq	1
	Rsi			rq	1
	Rdi			rq	1
	R8			rq	1
	R9			rq	1
	R10			rq	1
	R11			rq	1
	R12			rq	1
	R13			rq	1
	R14			rq	1
	R15			rq	1
; Program counter. Offset 0F8h
	Rip			rq	1
; Floating point state. Offset 100h
	FltSave			    XMMSAVEAREA64
; Vector registers. Offset 300h
	VectorRegister		rb	16*26
	VectorControl		rq	1
; Special debug control registers. Offset 4A8h
	DebugControl		rq	1
	LastBranchToRip		rq	1
	LastBranchFromRip	rq	1
	LastExceptionToRip	rq	1
	LastExceptionFromRip	rq	1

; offset 4D0h, end of legacy context
    AllOffset			rd	1		; intialized to -4d0h
    AllLength			rd	1		; initialized to 540h
    LegacyOffset		rd	1		; initialized to -4d0h
    LegacyLength		rd	1		; initialized to 4d0h
    XStateOffset		rd	1		; initialized to 30h
    XStateLength		rd	1		; initialized to 40h
                        rd	6		; padding, to keep align 40h of the following

; offset 500h
    XSaveHeader			rd	16		; zeroed when initialized (writen 40h zero bytes there)

; offset 540h
    YmmHighHalves		rb	16*16

                        rb	40h-1		; padding to allow to align the begin of context at 40h
ends

LEGACY_SAVE_AREA_LENGTH = (sizeof.LEGACYSAVEAREA + 15) and (not 15)
RUNTIME_FUNCTION_INDIRECT = 1

struct RUNTIMEFUNCTION
       BeginAddress dd 0
       EndAddress dd 0
       UnwindData dd 0
ends

macro InterlockedBitTestAndSet Base, Bit {
      mov eax, Bit
      mov ecx, Base
      lock bts [ecx], eax
      setc al
}

macro InterlockedBitTestAndReset Base, Bit {
      mov eax, Bit
      mov ecx, Base
      lock btr [ecx], eax
      setc al
}

macro InterlockedBitTestAndComplement Base, Bit {
      mov eax, Bit
      mov ecx, Base
      lock btc [ecx], eax
      setc al
}

macro DbgRaiseAssertionFailure {
      int $2c
}

EXCEPTION_READ_FAULT = 0
EXCEPTION_WRITE_FAULT = 1
EXCEPTION_EXECUTE_FAULT = 8

CONTEXT_ALPHA = $20000
CONTEXT_CONTROL = CONTEXT_ALPHA or 1
CONTEXT_FLOATING_POINT = CONTEXT_ALPHA or 2
CONTEXT_INTEGER = CONTEXT_ALPHA or 4
CONTEXT_FULL = CONTEXT_CONTROL or CONTEXT_FLOATING_POINT or CONTEXT_INTEGER

macro GetFiberData {
      mov eax, fs:[$10]
      mov eax, [eax]
}

macro GetCurrentFiber {
      mov eax, fs:[$10]
}

SIZE_OF_80387_REGISTERS = 80

CONTEXT_i386 = $10000
CONTEXT_i486 = $10000
CONTEXT_CONTROL = CONTEXT_i386 or 1
CONTEXT_INTEGER = CONTEXT_i386 or 2
CONTEXT_SEGMENTS = CONTEXT_i386 or 4
CONTEXT_FLOATING_POINT = CONTEXT_i386 or 8
CONTEXT_DEBUG_REGISTERS = CONTEXT_i386 or $10
CONTEXT_EXTENDED_REGISTERS = CONTEXT_i386 or $20
CONTEXT_FULL = CONTEXT_CONTROL or CONTEXT_INTEGER or CONTEXT_SEGMENTS
CONTEXT_ALL = CONTEXT_CONTROL or CONTEXT_INTEGER or CONTEXT_SEGMENTS or\
	      CONTEXT_FLOATING_POINT or CONTEXT_DEBUG_REGISTERS or CONTEXT_EXTENDED_REGISTERS

MAXIMUM_SUPPORTED_EXTENSION = 512

struct FLOATINGSAVEAREA
       ControlWord dd ?
       StatusWord dd ?
       TagWord dd ?
       ErrorOffset dd ?
       ErrorSelector dd ?
       DataOffset dd ?
       DataSelector dd ?
       RegisterArea db SIZE_OF_80387_REGISTERS dup(?)
       Cr0NpxState dd ?
ends

struct CONTEXT
       ContextFlags dd ?
       Dr0 dd ?
       Dr1 dd ?
       Dr2 dd ?
       Dr3 dd ?
       Dr6 dd ?
       Dr7 dd ?
       FloatSave FLOATINGSAVEAREA
       SegGs dd ?
       SegFs dd ?
       SegEs dd ?
       SegDs dd ?
       Edi dd ?
       Esi dd ?
       Ebx dd ?
       Edx dd ?
       Ecx dd ?
       Eax dd ?
       Ebp dd ?
       Eip dd ?
       SegCs dd ?
       EFlags dd ?
       Esp dd ?
       SegSs dd ?
       ExtendedRegisters db MAXIMUM_SUPPORTED_EXTENSION dup(?)
ends

struct LDTENTRY
       LimitLow dw ?
       BaseLow dw ?
       union
	   struct
	       BaseMid db ?
	       Flags1 db ?
	       Flags2 db ?
	       BaseHi db ?
	   ends
	   union
	       BaseMid1 dd ?
	       Type dd ?
	       Dpl dd ?
	       Pres dd ?
	       LimitHi dd ?
	       Sys dd ?
	       Reserved_0 dd ?
	       Default_Big dd ?
	       Granularity dd ?
	       BaseHi1 dd ?
	   ends
       ends
ends

MD_LFHINT_NONE = 0
MD_LFHINT_NT1 = 1
MD_LFHINT_NT2 = 2
MD_LFHINT_NTA = 3

PF_TEMPORAL_LEVEL_1 = MD_LFHINT_NONE
PF_NON_TEMPORAL_LEVEL_ALL = MD_LFHINT_NTA

CONTEXT_IA64 = $80000

CONTEXT64_CONTROL = (CONTEXT_IA64 OR 1)
CONTEXT64_LOWER_FLOATING_POINT = (CONTEXT_IA64 OR 2)
CONTEXT64_HIGHER_FLOATING_POINT = (CONTEXT_IA64 OR 4)
CONTEXT64_INTEGER = (CONTEXT_IA64 OR 8)
CONTEXT64_DEBUG = (CONTEXT_IA64 OR 10)
CONTEXT64_IA32_CONTROL = (CONTEXT_IA64 OR 20)
CONTEXT64_FLOATING_POINT = (CONTEXT64_LOWER_FLOATING_POINT OR CONTEXT64_HIGHER_FLOATING_POINT)
CONTEXT64_FULL = (CONTEXT64_CONTROL OR CONTEXT64_FLOATING_POINT OR CONTEXT64_INTEGER OR CONTEXT64_IA32_CONTROL)
CONTEXT64_ALL = (CONTEXT64_CONTROL OR CONTEXT64_FLOATING_POINT OR CONTEXT64_INTEGER OR CONTEXT64_DEBUG OR CONTEXT64_IA32_CONTROL)
CONTEXT64_EXCEPTION_ACTIVE = $8000000
CONTEXT64_SERVICE_ACTIVE = $10000000
CONTEXT64_EXCEPTION_REQUEST = $40000000
CONTEXT64_EXCEPTION_REPORTING = $80000000

SID_REVISION = 1
SID_MAX_SUB_AUTHORITIES = 15
SID_RECOMMENDED_SUB_AUTHORITIES = 1

struct SID
       Revision db ?
       SubAuthorityCount db ?
       IdentifierAuthority dd ?
       SubAuthority dd ANYSIZE_ARRAY dup(?)
ends

struct SIDANDATTRIBUTES
       Sid dq ?
       Attributes dd ?,?
ends

SidTypeUser = 1
SidTypeGroup = 2
SidTypeDomain = 3
SidTypeAlias = 4
SidTypeWellKnownGroup = 5
SidTypeDeletedAccount = 6
SidTypeInvalid = 7
SidTypeUnknown = 8
SidTypeComputer = 9

SECURITY_NULL_SID_AUTHORITY equ 0,0,0,0,0,0
SECURITY_WORLD_SID_AUTHORITY equ 0,0,0,0,0,1
SECURITY_LOCAL_SID_AUTHORITY equ 0,0,0,0,0,2
SECURITY_CREATOR_SID_AUTHORITY equ 0,0,0,0,0,3
SECURITY_NON_UNIQUE_AUTHORITY equ 0,0,0,0,0,4
SECURITY_RESOURCE_MANAGER_AUTHORITY equ 0,0,0,0,0,9
SECURITY_NULL_RID = 0
SECURITY_WORLD_RID = 0
SECURITY_LOCAL_RID = 0
SECURITY_CREATOR_OWNER_RID = 0
SECURITY_CREATOR_GROUP_RID = 1
SECURITY_CREATOR_OWNER_SERVER_RID = 2
SECURITY_CREATOR_GROUP_SERVER_RID = 3
SECURITY_NT_AUTHORITY equ 0,0,0,0,0,5
SECURITY_DIALUP_RID = 1
SECURITY_NETWORK_RID = 2
SECURITY_BATCH_RID = 3
SECURITY_INTERACTIVE_RID = 4
SECURITY_LOGON_IDS_RID = 5
SECURITY_LOGON_IDS_RID_COUNT = 3
SECURITY_SERVICE_RID = 6
SECURITY_ANONYMOUS_LOGON_RID = 5
SECURITY_PROXY_RID = 8
SECURITY_ENTERPRISE_CONTROLLERS_RID = 9
SECURITY_SERVER_LOGON_RID = SECURITY_ENTERPRISE_CONTROLLERS_RID
SECURITY_PRINCIPAL_SELF_RID = $A
SECURITY_AUTHENTICATED_USER_RID = $B
SECURITY_RESTRICTED_CODE_RID = $C
SECURITY_TERMINAL_SERVER_RID = $D
SECURITY_REMOTE_LOGON_RID = $E
SECURITY_THIS_ORGANIZATION_RID = $F
SECURITY_LOCAL_SYSTEM_RID = $12
SECURITY_LOCAL_SERVICE_RID = $13
SECURITY_NETWORK_SERVICE_RID = $14
SECURITY_NT_NON_UNIQUE = $15
SECURITY_NT_NON_UNIQUE_SUB_AUTH_COUNT = 3
SECURITY_BUILTIN_DOMAIN_RID = $20
SECURITY_PACKAGE_BASE_RID = $40
SECURITY_PACKAGE_RID_COUNT = 2
SECURITY_PACKAGE_NTLM_RID = $A
SECURITY_PACKAGE_SCHANNEL_RID = $E
SECURITY_PACKAGE_DIGEST_RID = $15
SECURITY_MAX_ALWAYS_FILTERED = $3E7
SECURITY_MIN_NEVER_FILTERED = $3E8
SECURITY_OTHER_ORGANIZATION_RID = $3E8

FOREST_USER_RID_MAX = $1F3
DOMAIN_USER_RID_ADMIN = $1F4
DOMAIN_USER_RID_GUEST = $1F5
DOMAIN_USER_RID_KRBTGT = $1F6
DOMAIN_USER_RID_MAX = $3E7

DOMAIN_GROUP_RID_ADMINS = $200
DOMAIN_GROUP_RID_USERS = $201
DOMAIN_GROUP_RID_GUESTS = $202
DOMAIN_GROUP_RID_COMPUTERS = $203
DOMAIN_GROUP_RID_CONTROLLERS = $204
DOMAIN_GROUP_RID_CERT_ADMINS = $205
DOMAIN_GROUP_RID_SCHEMA_ADMINS = $206
DOMAIN_GROUP_RID_ENTERPRISE_ADMINS = $207
DOMAIN_GROUP_RID_POLICY_ADMINS = $208

DOMAIN_ALIAS_RID_ADMINS = $220
DOMAIN_ALIAS_RID_USERS = $221
DOMAIN_ALIAS_RID_GUESTS = $222
DOMAIN_ALIAS_RID_POWER_USERS = $223
DOMAIN_ALIAS_RID_ACCOUNT_OPS = $224
DOMAIN_ALIAS_RID_SYSTEM_OPS = $225
DOMAIN_ALIAS_RID_PRINT_OPS = $226
DOMAIN_ALIAS_RID_BACKUP_OPS = $227
DOMAIN_ALIAS_RID_REPLICATOR = $228
DOMAIN_ALIAS_RID_RAS_SERVERS = $229
DOMAIN_ALIAS_RID_PREW2KCOMPACCESS = $22A
DOMAIN_ALIAS_RID_REMOTE_DESKTOP_USERS = $22B
DOMAIN_ALIAS_RID_NETWORK_CONFIGURATION_OPS = $22C
DOMAIN_ALIAS_RID_INCOMING_FOREST_TRUST_BUILDERS = $22D
DOMAIN_ALIAS_RID_MONITORING_USERS = $22E
DOMAIN_ALIAS_RID_LOGGING_USERS = $22F
DOMAIN_ALIAS_RID_AUTHORIZATIONACCESS = $230
DOMAIN_ALIAS_RID_TS_LICENSE_SERVERS = $231
DOMAIN_ALIAS_RID_DCOM_USERS = $232

WinNullSid = 0
WinWorldSid = 1
WinLocalSid = 2
WinCreatorOwnerSid = 3
WinCreatorGroupSid = 4
WinCreatorOwnerServerSid = 5
WinCreatorGroupServerSid = 6
WinNtAuthoritySid = 7
WinDialupSid = 8
WinNetworkSid = 9
WinBatchSid = 10
WinInteractiveSid = 11
WinServiceSid = 12
WinAnonymousSid = 13
WinProxySid = 14
WinEnterpriseControllersSid = 15
WinSelfSid = 16
WinAuthenticatedUserSid = 17
WinRestrictedCodeSid = 18
WinTerminalServerSid = 19
WinRemoteLogonIdSid = 20
WinLogonIdsSid = 21
WinLocalSystemSid = 22
WinLocalServiceSid = 23
WinNetworkServiceSid = 24
WinBuiltinDomainSid = 25
WinBuiltinAdministratorsSid = 26
WinBuiltinUsersSid = 27
WinBuiltinGuestsSid = 28
WinBuiltinPowerUsersSid = 29
WinBuiltinAccountOperatorsSid = 30
WinBuiltinSystemOperatorsSid = 31
WinBuiltinPrintOperatorsSid = 32
WinBuiltinBackupOperatorsSid = 33
WinBuiltinReplicatorSid = 34
WinBuiltinPreWindows2000CompatibleAccessSid = 35
WinBuiltinRemoteDesktopUsersSid = 36
WinBuiltinNetworkConfigurationOperatorsSid = 37
WinAccountAdministratorSid = 38
WinAccountGuestSid = 39
WinAccountKrbtgtSid = 40
WinAccountDomainAdminsSid = 41
WinAccountDomainUsersSid = 42
WinAccountDomainGuestsSid = 43
WinAccountComputersSid = 44
WinAccountControllersSid = 45
WinAccountCertAdminsSid = 46
WinAccountSchemaAdminsSid = 47
WinAccountEnterpriseAdminsSid = 48
WinAccountPolicyAdminsSid = 49
WinAccountRasAndIasServersSid = 50
WinNTLMAuthenticationSid = 51
WinDigestAuthenticationSid = 52
WinSChannelAuthenticationSid = 53
WinThisOrganizationSid = 54
WinOtherOrganizationSid = 55
WinBuiltinIncomingForestTrustBuildersSid = 56
WinBuiltinPerfMonitoringUsersSid = 57
WinBuiltinPerfLoggingUsersSid = 58
WinBuiltinAuthorizationAccessSid = 59
WinBuiltinTerminalServerLicenseServersSid = 60
WinBuiltinDCOMUsersSid = 61

SYSTEM_LUID equ $3E7, $0
ANONYMOUS_LOGON_LUID equ $3e6, $0
LOCALSERVICE_LUID equ $3e5, $0
NETWORKSERVICE_LUID equ $3e4, $0

SE_GROUP_MANDATORY = 1
SE_GROUP_ENABLED_BY_DEFAULT = 2
SE_GROUP_ENABLED = 4
SE_GROUP_OWNER = 8
SE_GROUP_USE_FOR_DENY_ONLY = $10
SE_GROUP_LOGON_ID = $C0000000
SE_GROUP_RESOURCE = $20000000

ACL_REVISION = 2
ACL_REVISION_DS = 4

ACL_REVISION1 = 1
MIN_ACL_REVISION = ACL_REVISION2
ACL_REVISION2 = 2
ACL_REVISION3 = 3
ACL_REVISION4 = 4
MAX_ACL_REVISION = ACL_REVISION4

struct ACL
       AclRevision db ?
       Sbz1 db ?
       AclSize db ?
       AceCount db ?
       Sbz2 db ?,?,?,?
ends

struct ACEHEADER
       AceType db ?
       AceFlags db ?
       AceSize dw ?
ends

ACCESS_MIN_MS_ACE_TYPE = 0
ACCESS_ALLOWED_ACE_TYPE = 0
ACCESS_DENIED_ACE_TYPE = 1
SYSTEM_AUDIT_ACE_TYPE = 2
SYSTEM_ALARM_ACE_TYPE = 3
ACCESS_MAX_MS_V2_ACE_TYPE = 3
ACCESS_ALLOWED_COMPOUND_ACE_TYPE = 4
ACCESS_MAX_MS_V3_ACE_TYPE = 4
ACCESS_MIN_MS_OBJECT_ACE_TYPE = 5
ACCESS_ALLOWED_OBJECT_ACE_TYPE = 5
ACCESS_DENIED_OBJECT_ACE_TYPE = 6
SYSTEM_AUDIT_OBJECT_ACE_TYPE = 7
SYSTEM_ALARM_OBJECT_ACE_TYPE = 8
ACCESS_MAX_MS_OBJECT_ACE_TYPE = 8
ACCESS_MAX_MS_V4_ACE_TYPE = 8
ACCESS_MAX_MS_ACE_TYPE = 8
ACCESS_ALLOWED_CALLBACK_ACE_TYPE = 9
ACCESS_DENIED_CALLBACK_ACE_TYPE = $A
ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE = $B
ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE = $C
SYSTEM_AUDIT_CALLBACK_ACE_TYPE = $D
SYSTEM_ALARM_CALLBACK_ACE_TYPE = $E
SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE = $F
SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE = $10
ACCESS_MAX_MS_V5_ACE_TYPE = $10

OBJECT_INHERIT_ACE = 1
CONTAINER_INHERIT_ACE = 2
NO_PROPAGATE_INHERIT_ACE = 4
INHERIT_ONLY_ACE = $8
INHERITED_ACE = $10
VALID_INHERIT_FLAGS = $1F
SUCCESSFUL_ACCESS_ACE_FLAG = $40
FAILED_ACCESS_ACE_FLAG = $80

struct ACCESSALLOWEDACE
       Header ACEHEADER
       Mask dd ?
       SidStart dd ?
ends

struct ACCESSDENIEDACE
       Header ACEHEADER
       Mask dd ?
       SidStart dd ?
ends

struct SYSTEMAUDITACE
       Header ACEHEADER
       Mask dd ?
       SidStart dd ?
ends

struct SYSTEMALARMACE
       Header ACEHEADER
       Mask dd ?
       SidStart dd ?
ends

struct ACCESSALLOWEDOBJECTACE
       Header ACEHEADER
       Mask dd ?
       Flags dd ?
       ObjectType GUID
       InheritedObjectType GUID
       SidStart dd ?
ends

struct ACCESSDENIEDOBJECTACE
       Header ACEHEADER
       Mask dd ?
       Flags dd ?
       ObjectType GUID
       InheritedObjectType GUID
       SidStart dd ?
ends

struct SYSTEMAUDITOBJECTACE
       Header ACEHEADER
       Mask dd ?
       Flags dd ?
       ObjectType GUID
       InheritedObjectType GUID
       SidStart dd ?
ends

struct SYSTEMALARMOBJECTACE
       Header ACEHEADER
       Mask dd ?
       Flags dd ?
       ObjectType GUID
       InheritedObjectType GUID
       SidStart dd ?
ends

struct ACCESSALLOWEDCALLBACKACE
       Header ACEHEADER
       Mask dd ?
       SidStart dd ?
ends

struct ACCESSDENIEDCALLBACKACE
       Header ACEHEADER
       Mask dd ?
       SidStart dd ?
ends

struct SYSTEMAUDITCALLBACKACE
       Header ACEHEADER
       Mask dd ?
       SidStart dd ?
ends

struct SYSTEMALARMCALLBACKACE
       Header ACEHEADER
       Mask dd ?
       SidStart dd ?
ends

struct ACCESSALLOWEDCALLBACKOBJECTACE
       Header ACEHEADER
       Mask dd ?
       Flags dd ?
       ObjectType GUID
       InheritedObjectType GUID
       SidStart dd ?
ends

struct ACCESSDENIEDCALLBACKOBJECTACE
       Header ACEHEADER
       Mask dd ?
       Flags dd ?
       ObjectType GUID
       InheritedObjectType GUID
       SidStart dd ?
ends

struct SYSTEMAUDITCALLBACKOBJECTACE
       Header ACEHEADER
       Mask dd ?
       Flags dd ?
       ObjectType GUID
       InheritedObjectType GUID
       SidStart dd ?
ends

struct SYSTEMALARMCALLBACKOBJECTACE
       Header ACEHEADER
       Mask dd ?
       Flags dd ?
       ObjectType GUID
       InheritedObjectType GUID
       SidStart dd ?
ends

ACE_OBJECT_TYPE_PRESENT = 1
ACE_INHERITED_OBJECT_TYPE_PRESENT = 2

AclRevisionInformation = 1
AclSizeInformation = 2

struct ACLREVISIONINFORMATION
       AclRevision dd ?
ends

struct ACLSIZEINFORMATION
       AceCount dd ?
       AclBytesInUse dd ?
       AclBytesFree dd ?
ends

SECURITY_DESCRIPTOR_REVISION = 1
SECURITY_DESCRIPTOR_REVISION1 = 1
SECURITY_DESCRIPTOR_MIN_LENGTH = sizeof.SECURITYDESCRIPTOR

SE_OWNER_DEFAULTED = 1
SE_GROUP_DEFAULTED = 2
SE_DACL_PRESENT = 4
SE_DACL_DEFAULTED = 8
SE_SACL_PRESENT = $10
SE_SACL_DEFAULTED = $20
SE_DACL_AUTO_INHERIT_REQ = $100
SE_SACL_AUTO_INHERIT_REQ = $200
SE_DACL_AUTO_INHERITED = $400
SE_SACL_AUTO_INHERITED = $800
SE_DACL_PROTECTED = $1000
SE_SACL_PROTECTED = $2000
SE_RM_CONTROL_VALID = $4000
SE_SELF_RELATIVE = $8000

struct SECURITYDESCRIPTORRELATIVE
       Revision db ?
       Sbz1 db ?
       Control dw ?
       Owner dd ?
       Group dd ?
       Sacl dd ?
       Dacl dd ?
ends

struct OBJECTTYPELIST
       Level dw ?
       Sbz dw ?,?,?
       ObjectType dq ?
ends

; DS values for Level
ACCESS_OBJECT_GUID = 0
ACCESS_PROPERTY_SET_GUID = 1
ACCESS_PROPERTY_GUID = 2
ACCESS_MAX_LEVEL = 4

; Parameters to NtAccessCheckByTypeAndAditAlarm
AuditEventObjectAccess = 0
AuditEventDirectoryServiceAccess = 1

AUDIT_ALLOW_NO_PRIVILEGE = 1

ACCESS_DS_SOURCE_A equ "DS"
ACCESS_DS_SOURCE_W equ "DS"
ACCESS_DS_OBJECT_TYPE_NAME_A equ "Directory Service Object"
ACCESS_DS_OBJECT_TYPE_NAME_W equ "Directory Service Object"

SE_PRIVILEGE_ENABLED_BY_DEFAULT = 1
SE_PRIVILEGE_ENABLED = 2
SE_PRIVILEGE_REMOVED = 4
SE_PRIVILEGE_USED_FOR_ACCESS = $80000000

; Privilege Set Control flags
PRIVILEGE_SET_ALL_NECESSARY = 1

struct PRIVILEGESET
       PrivilegeCount dd ?
       Control dd ?
       Privilege LUIDANDATTRIBUTES
ends

SE_CREATE_TOKEN_NAME equ "SeCreateTokenPrivilege"
SE_ASSIGNPRIMARYTOKEN_NAME equ "SeAssignPrimaryTokenPrivilege"
SE_LOCK_MEMORY_NAME equ "SeLockMemoryPrivilege"
SE_INCREASE_QUOTA_NAME equ "SeIncreaseQuotaPrivilege"
SE_UNSOLICITED_INPUT_NAME equ "SeUnsolicitedInputPrivilege"
SE_MACHINE_ACCOUNT_NAME equ "SeMachineAccountPrivilege"
SE_TCB_NAME equ "SeTcbPrivilege"
SE_SECURITY_NAME equ "SeSecurityPrivilege"
SE_TAKE_OWNERSHIP_NAME equ "SeTakeOwnershipPrivilege"
SE_LOAD_DRIVER_NAME equ "SeLoadDriverPrivilege"
SE_SYSTEM_PROFILE_NAME equ "SeSystemProfilePrivilege"
SE_SYSTEMTIME_NAME equ "SeSystemtimePrivilege"
SE_PROF_SINGLE_PROCESS_NAME equ "SeProfileSingleProcessPrivilege"
SE_INC_BASE_PRIORITY_NAME equ "SeIncreaseBasePriorityPrivilege"
SE_CREATE_PAGEFILE_NAME equ "SeCreatePagefilePrivilege"
SE_CREATE_PERMANENT_NAME equ "SeCreatePermanentPrivilege"
SE_BACKUP_NAME equ "SeBackupPrivilege"
SE_RESTORE_NAME equ "SeRestorePrivilege"
SE_SHUTDOWN_NAME equ "SeShutdownPrivilege"
SE_DEBUG_NAME equ "SeDebugPrivilege"
SE_AUDIT_NAME equ "SeAuditPrivilege"
SE_SYSTEM_ENVIRONMENT_NAME equ "SeSystemEnvironmentPrivilege"
SE_CHANGE_NOTIFY_NAME equ "SeChangeNotifyPrivilege"
SE_REMOTE_SHUTDOWN_NAME equ "SeRemoteShutdownPrivilege"
SE_UNDOCK_NAME equ "SeUndockPrivilege"
SE_SYNC_AGENT_NAME equ "SeSyncAgentPrivilege"
SE_ENABLE_DELEGATION_NAME equ "SeEnableDelegationPrivilege"
SE_MANAGE_VOLUME_NAME equ "SeManageVolumePrivilege"
SE_IMPERSONATE_NAME equ "SeImpersonatePrivilege"
SE_CREATE_GLOBAL_NAME equ "SeCreateGlobalPrivilege"

SecurityAnonymous = 0
SecurityIdentification = 1
SecurityImpersonation = 2
SecurityDelegation = 3

SECURITY_MAX_IMPERSONATION_LEVEL = SecurityDelegation
SECURITY_MIN_IMPERSONATION_LEVEL  = SecurityAnonymous
DEFAULT_IMPERSONATION_LEVEL  = SecurityImpersonation

DELETE = $10000
READ_CONTROL = $20000
WRITE_DAC = $40000
WRITE_OWNER = $80000
SYNCHRONIZE = $100000
STANDARD_RIGHTS_REQUIRED = $F0000
STANDARD_RIGHTS_READ = READ_CONTROL
STANDARD_RIGHTS_WRITE = READ_CONTROL
STANDARD_RIGHTS_EXECUTE = READ_CONTROL
STANDARD_RIGHTS_ALL = $1F0000
SPECIFIC_RIGHTS_ALL = $FFFF
ACCESS_SYSTEM_SECURITY = $1000000
MAXIMUM_ALLOWED = $2000000
GENERIC_READ = $80000000
GENERIC_WRITE = $40000000
GENERIC_EXECUTE = $20000000
GENERIC_ALL = $10000000

struct GENERICMAPPING
       GenericRead dd ?
       GenericWrite dd ?
       GenericExecute dd ?
       GenericAll dd ?
ends

struct SIDIDENTIFIERAUTHORITY
       Value db 6 dup(?)
ends

SID_REVISION = 1
SID_MAX_SUB_AUTHORITIES = 15
SID_RECOMMENDED_SUB_AUTHORITIES = 1

SidTypeUser = 1
SidTypeGroup = 2
SidTypeDomain = 3
SidTypeAlias = 4
SidTypeWellKnownGroup = 5
SidTypeDeletedAccount = 6
SidTypeInvalid = 7
SidTypeUnknown = 8
SidTypeComputer = 9

TOKEN_ASSIGN_PRIMARY = 1
TOKEN_DUPLICATE = 2
TOKEN_IMPERSONATE = 4
TOKEN_QUERY = 8
TOKEN_QUERY_SOURCE = $10
TOKEN_ADJUST_PRIVILEGES = $20
TOKEN_ADJUST_GROUPS = $40
TOKEN_ADJUST_DEFAULT = $80
TOKEN_ADJUST_SESSIONID = $100
TOKEN_ALL_ACCESS_P = STANDARD_RIGHTS_REQUIRED or \
		     TOKEN_ASSIGN_PRIMARY or \
		     TOKEN_DUPLICATE or \
		     TOKEN_IMPERSONATE or \
		     TOKEN_QUERY or \
		     TOKEN_QUERY_SOURCE or \
		     TOKEN_ADJUST_PRIVILEGES or \
		     TOKEN_ADJUST_GROUPS or \
		     TOKEN_ADJUST_DEFAULT

TOKEN_ALL_ACCESS = TOKEN_ALL_ACCESS_P or \
		   TOKEN_ADJUST_SESSIONID

TOKEN_READ = STANDARD_RIGHTS_READ or \
	     TOKEN_QUERY


TOKEN_WRITE = STANDARD_RIGHTS_WRITE or \
	      TOKEN_ADJUST_PRIVILEGES or \
	      TOKEN_ADJUST_GROUPS or \
	      TOKEN_ADJUST_DEFAULT

TOKEN_EXECUTE = STANDARD_RIGHTS_EXECUTE

TokenPrimary = 1
TokenImpersonation = 2

TokenUser = 1
TokenGroups = 2
TokenPrivileges = 3
TokenOwner = 4
TokenPrimaryGroup = 5
TokenDefaultDacl = 6
TokenSource = 7
TokenType = 8
TokenImpersonationLevel = 9
TokenStatistics = 10
TokenRestrictedSids = 11
TokenSessionId = 12
TokenGroupsAndPrivileges = 13
TokenSessionReference = 14
TokenSandBoxInert = 15
TokenAuditPolicy = 16
TokenOrigin = 17
MaxTokenInfoClass = 18

struct TOKENUSER
       User SIDANDATTRIBUTES
ends

struct TOKENGROUPS
       GroupCount dd ?
       Groups SIDANDATTRIBUTES
	      db ANYSIZE_ARRAY*sizeof.SIDANDATTRIBUTES dup(?)
ends

struct TOKENPRIVILEGES
       PrivilegeCount dd ?
       Privileges SIDANDATTRIBUTES
		  db ANYSIZE_ARRAY*sizeof.SIDANDATTRIBUTES dup(?)
ends

struct TOKENOWNER
       Owner dq ?
ends

struct TOKENPRIMARYGROUP
       PrimaryGroup dq ?
ends

struct TOKENDEFAULTDACL
       DefaultDacl dq ?
ends

struct TOKENGROUPSANDPRIVILEGES
       SidCount dd ?
       SidLength dd ?
       Sids dq ?
       RestrictedSidCount dd ?
       RestrictedSidLength dd ?
       RestrictedSids dq ?
       PrivilegeCount dd ?
       PrivilegeLength dd ?
       Privileges dq ?
       AuthenticationId LUID
ends

; Valid bits for each TOKEN_AUDIT_POLICY policy mask field.
TOKEN_AUDIT_SUCCESS_INCLUDE = 1
TOKEN_AUDIT_SUCCESS_EXCLUDE = 2
TOKEN_AUDIT_FAILURE_INCLUDE = 4
TOKEN_AUDIT_FAILURE_EXCLUDE = 8

VALID_AUDIT_POLICY_BITS = TOKEN_AUDIT_SUCCESS_INCLUDE or \
			  TOKEN_AUDIT_SUCCESS_EXCLUDE or \
			  TOKEN_AUDIT_FAILURE_INCLUDE or \
			  TOKEN_AUDIT_FAILURE_EXCLUDE

POLICY_AUDIT_SUBCATEGORY_COUNT = 52

struct TOKENAUDITPOLICY
       PerUserPolicy db ((POLICY_AUDIT_SUBCATEGORY_COUNT shr 1) + 1) dup(?)
ends

TOKEN_SOURCE_LENGTH = 8

struct TOKENSOURCE
       SourceName db TOKEN_SOURCE_LENGTH dup(?)
       SourceIdentifier LUID
ends

struct TOKENSTATISTICS
       TokenId LUID
       AuthenticationId LUID
       ExpirationTime dq ?
       TokenType dd ?
       ImpersonationLevel dd ?
       DynamicCharged dd ?
       DynamicAvailable dd ?
       GroupCount dd ?
       PrivilegeCount dd ?
       ModifiedId LUID
ends

struct TOKENCONTROL
       TokenId LUID
       AuthenticationId LUID
       ModifiedId LUID
       TokenSource TOKENSOURCE
ends

struct TOKENORIGIN
       OriginatingLogonSession LUID
ends

SECURITY_DYNAMIC_TRACKING = TRUE
SECURITY_STATIC_TRACKING = FALSE

struct SECURITYQUALITYOFSERVICE
       Length dd ?
       ImpersonationLevel dd ?
       ContextTrackingMode db ?
       EffectiveOnly db ?,?,?
ends

; Used to represent information related to a thread impersonation
struct SEIMPERSONATIONSTATE
       Token dq ?
       CopyOnOpen db ?
       EffectiveOnly db ?
       Level dd ?
       pad   dw ?
ends

DISABLE_MAX_PRIVILEGE = 1
SANDBOX_INERT = 2
OWNER_SECURITY_INFORMATION = 1
GROUP_SECURITY_INFORMATION = 2
DACL_SECURITY_INFORMATION = 4
SACL_SECURITY_INFORMATION = 8
PROTECTED_DACL_SECURITY_INFORMATION = $80000000
PROTECTED_SACL_SECURITY_INFORMATION = $40000000
UNPROTECTED_DACL_SECURITY_INFORMATION = $20000000
UNPROTECTED_SACL_SECURITY_INFORMATION = $10000000
PROCESS_TERMINATE = 1
PROCESS_CREATE_THREAD = 2
PROCESS_SET_SESSIONID = 4
PROCESS_VM_OPERATION = 8
PROCESS_VM_READ = $10
PROCESS_VM_WRITE = $20
PROCESS_DUP_HANDLE = $40
PROCESS_CREATE_PROCESS = $80
PROCESS_SET_QUOTA = $100
PROCESS_SET_INFORMATION = $200
PROCESS_QUERY_INFORMATION = $400
PROCESS_SUSPEND_RESUME = $800
PROCESS_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or $FFF

MAXIMUM_PROCESSORS = 32

THREAD_TERMINATE = 1
THREAD_SUSPEND_RESUME = 2
THREAD_GET_CONTEXT = 8
THREAD_SET_CONTEXT = $10
THREAD_SET_INFORMATION = $20
THREAD_QUERY_INFORMATION = $40
THREAD_SET_THREAD_TOKEN = $80
THREAD_IMPERSONATE = $100
THREAD_DIRECT_IMPERSONATION = $200
THREAD_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or $3FF

JOB_OBJECT_ASSIGN_PROCESS = 1
JOB_OBJECT_SET_ATTRIBUTES = 2
JOB_OBJECT_QUERY = 4
JOB_OBJECT_TERMINATE = 8
JOB_OBJECT_SET_SECURITY_ATTRIBUTES = $10
JOB_OBJECT_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or $1F

struct JOBSETARRAY
       JobHandle dq ?
       MemberLevel dd ?
       Flags dd ?
ends

FLS_MAXIMUM_AVAILABLE = 128
TLS_MINIMUM_AVAILABLE = 64

struct NTTIB64
       ExceptionList dq ?
       StackBase dq ?
       StackLimit dq ?
       SubSystemTib dq ?
       union
	   FiberData dq ?
	   Version dd ?
       ends
       ArbitraryUserPointer dq ?
       Self dq ?
ends

THREAD_BASE_PRIORITY_LOWRT = 15
THREAD_BASE_PRIORITY_MAX = 2
THREAD_BASE_PRIORITY_MIN = -2
THREAD_BASE_PRIORITY_IDLE = -15

struct QUOTALIMITS
       PagedPoolLimit dq ?
       NonPagedPoolLimit dq ?
       MinimumWorkingSetSize dq ?
       MaximumWorkingSetSize dq ?
       PagefileLimit dq ?
       TimeLimit LARGEINTEGER
ends

QUOTA_LIMITS_HARDWS_MIN_ENABLE = 1
QUOTA_LIMITS_HARDWS_MIN_DISABLE = 2
QUOTA_LIMITS_HARDWS_MAX_ENABLE = 4
QUOTA_LIMITS_HARDWS_MAX_DISABLE = 8

struct RATEQUOTALIMIT
       union
	   RateData dd ?
	   RatePercent dd ?
	   Reserved0 dd ?
       ends
ends

struct QUOTALIMITSEX
       PagedPoolLimit dq ?
       NonPagedPoolLimit dq ?
       MinimumWorkingSetSize dq ?
       MaximumWorkingSetSize dq ?
       PagefileLimit dq ?
       TimeLimit LARGEINTEGER
       Reserved1 dq ?
       Reserved2 dq ?
       Reserved3 dq ?
       Reserved4 dq ?
       Flags dd ?
       CpuRateLimit RATEQUOTALIMIT
ends

struct IOCOUNTERS
       ReadOperationCount dq ?
       WriteOperationCount dq ?
       OtherOperationCount dq ?
       ReadTransferCount dq ?
       WriteTransferCount dq ?
       OtherTransferCount dq ?
ends

struct JOBOBJECTBASICACCOUNTINGINFORMATION
       TotalUserTime LARGEINTEGER
       TotalKernelTime LARGEINTEGER
       ThisPeriodTotalUserTime LARGEINTEGER
       ThisPeriodTotalKernelTime LARGEINTEGER
       TotalPageFaultCount dd ?
       TotalProcesses dd ?
       ActiveProcesses dd ?
       TotalTerminatedProcesses dd ?
ends

struct JOBOBJECTBASICLIMITINFORMATION
       PerProcessUserTimeLimit LARGEINTEGER
       PerJobUserTimeLimit LARGEINTEGER
       LimitFlags dd ?
       pad1 dd ?
       MinimumWorkingSetSize dq ?
       MaximumWorkingSetSize dq ?
       ActiveProcessLimit dd ?
       pad2 dd ?
       Affinity dq ?
       PriorityClass dd ?
       SchedulingClass dd ?
ends

struct JOBOBJECTEXTENDEDLIMITINFORMATION
       BasicLimitInformation JOBOBJECTBASICLIMITINFORMATION ;64
       IoInfo IOCOUNTERS ;48
       ProcessMemoryLimit dq ? ;32
       JobMemoryLimit dq ?
       PeakProcessMemoryUsed dq ?
       peakJobMemoryUsed dq ?
ends

struct JOBOBJECTBASICPROCESSIDLIST
       NumberOfAssignedProcesses dd ?
       NumberOfProcessIdsInList dd ?
       ProcessIdList dq ?
ends

struct JOBOBJECTBASICUIRESTRICTIONS
       UIRestrictionsClass dd ?
ends

struct JOBOBJECTSECURITYLIMITINFORMATION
       SecurityLimitFlags dd ?
       pad1 dd ?
       JobToken dq ?
       SidsToDisable dq ?
       PrivilegesToDelete dq ?
       RestrictedSids dq ?
ends

struct JOBOBJECTENDOFJOBTIMEINFORMATION
       EndOfJobTimeAction dd ?
ends

struct JOBOBJECTASSOCIATECOMPLETIONPORT
       CompletionKey dq ?
       CompletionPort dq ?
ends

struct JOBOBJECTBASICANDIOACCOUNTINGINFORMATION
       BasicInfo JOBOBJECTBASICACCOUNTINGINFORMATION
       IoInfo IOCOUNTERS
ends

struct JOBOBJECTJOBSETINFORMATION
       MemberLevel dd ?
ends

JOB_OBJECT_TERMINATE_AT_END_OF_JOB = 0
JOB_OBJECT_POST_AT_END_OF_JOB = 1

; Completion Port Messages for job objects
; These values are returned via the lpNumberOfBytesTransferred parameter
JOB_OBJECT_MSG_END_OF_JOB_TIME = 1
JOB_OBJECT_MSG_END_OF_PROCESS_TIME = 2
JOB_OBJECT_MSG_ACTIVE_PROCESS_LIMIT = 3
JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO = 4
JOB_OBJECT_MSG_NEW_PROCESS = 6
JOB_OBJECT_MSG_EXIT_PROCESS = 7
JOB_OBJECT_MSG_ABNORMAL_EXIT_PROCESS = 8
JOB_OBJECT_MSG_PROCESS_MEMORY_LIMIT = 9
JOB_OBJECT_MSG_JOB_MEMORY_LIMIT = 10

; Basic Limits
JOB_OBJECT_LIMIT_WORKINGSET = 1
JOB_OBJECT_LIMIT_PROCESS_TIME = 2
JOB_OBJECT_LIMIT_JOB_TIME = 4
JOB_OBJECT_LIMIT_ACTIVE_PROCESS = 8
JOB_OBJECT_LIMIT_AFFINITY = $10
JOB_OBJECT_LIMIT_PRIORITY_CLASS = $20
JOB_OBJECT_LIMIT_PRESERVE_JOB_TIME = $40
JOB_OBJECT_LIMIT_SCHEDULING_CLASS = $80
JOB_OBJECT_LIMIT_PROCESS_MEMORY = $100
JOB_OBJECT_LIMIT_JOB_MEMORY = $200
JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION = $400
JOB_OBJECT_LIMIT_BREAKAWAY_OK = $800
JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK = $1000
JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE = $2000
JOB_OBJECT_LIMIT_RESERVED2 = $4000
JOB_OBJECT_LIMIT_RESERVED3 = $8000
JOB_OBJECT_LIMIT_RESERVED4 = $10000
JOB_OBJECT_LIMIT_RESERVED5 = $20000
JOB_OBJECT_LIMIT_RESERVED6 = $40000
JOB_OBJECT_LIMIT_VALID_FLAGS = $7ffff
JOB_OBJECT_BASIC_LIMIT_VALID_FLAGS = $ff
JOB_OBJECT_EXTENDED_LIMIT_VALID_FLAGS = $3fff
JOB_OBJECT_RESERVED_LIMIT_VALID_FLAGS = $7ffff

; UI restrictions for jobs
JOB_OBJECT_UILIMIT_NONE = 0
JOB_OBJECT_UILIMIT_HANDLES = 1
JOB_OBJECT_UILIMIT_READCLIPBOARD = 2
JOB_OBJECT_UILIMIT_WRITECLIPBOARD = 4
JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS = 8
JOB_OBJECT_UILIMIT_DISPLAYSETTINGS = $10
JOB_OBJECT_UILIMIT_GLOBALATOMS = $20
JOB_OBJECT_UILIMIT_DESKTOP = $40
JOB_OBJECT_UILIMIT_EXITWINDOWS = $80
JOB_OBJECT_UILIMIT_ALL = $FF
JOB_OBJECT_UI_VALID_FLAGS = $FF
JOB_OBJECT_SECURITY_NO_ADMIN = 1
JOB_OBJECT_SECURITY_RESTRICTED_TOKEN = 2
JOB_OBJECT_SECURITY_ONLY_TOKEN = 4
JOB_OBJECT_SECURITY_FILTER_TOKENS = 8
JOB_OBJECT_SECURITY_VALID_FLAGS = $f

JobObjectBasicAccountingInformation = 1
JobObjectBasicLimitInformation = 2
JobObjectBasicProcessIdList = 3
JobObjectBasicUIRestrictions = 4
JobObjectSecurityLimitInformation = 5
JobObjectEndOfJobTimeInformation = 6
JobObjectAssociateCompletionPortInformation = 7
JobObjectBasicAndIoAccountingInformation = 8
JobObjectExtendedLimitInformation = 9
JobObjectJobSetInformation = 10
MaxJobObjectInfoClass = 11

EVENT_MODIFY_STATE = 2
EVENT_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or $3
MUTANT_QUERY_STATE = 1
MUTANT_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or MUTANT_QUERY_STATE
SEMAPHORE_MODIFY_STATE = 2
SEMAPHORE_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or $3

; Timer Specific Access Rights.
TIMER_QUERY_STATE = 1
TIMER_MODIFY_STATE = 2
TIMER_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or TIMER_QUERY_STATE or TIMER_MODIFY_STATE
TIME_ZONE_ID_UNKNOWN = 0
TIME_ZONE_ID_STANDARD = 1
TIME_ZONE_ID_DAYLIGHT = 2

RelationProcessorCore = 0
RelationNumaNode = 1
RelationCache = 2

LTP_PC_SMT = 1

CacheUnified = 0
CacheInstruction = 1
CacheData = 2
CacheTrace = 3

CACHE_FULLY_ASSOCIATIVE = $FF

LTP_PC_SMT = 1

struct CACHEDESCRIPTOR
       Level db ?
       Associativity db ?
       LineSize dw ?
       Size dd ?
       Type dd ?
ends

struct SYSTEMLOGICALPROCESSORINFORMATION
       ProcessorMask dq ?
       Relationship dd ?,?
       union
	       struct
		       Flags db ?
		       NodeNumber dd ?
	       ends
	       Cache CACHEDESCRIPTOR
	       Reserved dq ?, ?
       ends
ends

PROCESSOR_INTEL_386 = 386
PROCESSOR_INTEL_486 = 486
PROCESSOR_INTEL_PENTIUM = 586
PROCESSOR_INTEL_IA64 = 2200
PROCESSOR_AMD_X8664 = 8664
PROCESSOR_MIPS_R4000 = 4000    ; incl R4101 & R3910 for Windows CE
PROCESSOR_ALPHA_21064 = 21064
PROCESSOR_PPC_601 = 601
PROCESSOR_PPC_603 = 603
PROCESSOR_PPC_604 = 604
PROCESSOR_PPC_620 = 620
PROCESSOR_HITACHI_SH3 = 10003	; Windows CE
PROCESSOR_HITACHI_SH3E = 10004	 ; Windows CE
PROCESSOR_HITACHI_SH4 = 10005	; Windows CE
PROCESSOR_MOTOROLA_821 = 821	 ; Windows CE
PROCESSOR_SHx_SH3 = 103     ; Windows CE
PROCESSOR_SHx_SH4 = 104     ; Windows CE
PROCESSOR_STRONGARM = 2577    ; Windows CE - $A11
PROCESSOR_ARM720 = 1824    ; Windows CE - $720
PROCESSOR_ARM820 = 2080    ; Windows CE - $820
PROCESSOR_ARM920 = 2336    ; Windows CE - $920
PROCESSOR_ARM_7TDMI = 70001   ; Windows CE
PROCESSOR_OPTIL = $494f  ; MSIL

PROCESSOR_ARCHITECTURE_INTEL = 0
PROCESSOR_ARCHITECTURE_MIPS = 1
PROCESSOR_ARCHITECTURE_ALPHA = 2
PROCESSOR_ARCHITECTURE_PPC = 3
PROCESSOR_ARCHITECTURE_SHX = 4
PROCESSOR_ARCHITECTURE_ARM = 5
PROCESSOR_ARCHITECTURE_IA64 = 6
PROCESSOR_ARCHITECTURE_ALPHA64 = 7
PROCESSOR_ARCHITECTURE_MSIL = 8
PROCESSOR_ARCHITECTURE_AMD64 = 9
PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 = 10
PROCESSOR_ARCHITECTURE_UNKNOWN = $FFFF

PF_FLOATING_POINT_PRECISION_ERRATA = 0
PF_FLOATING_POINT_EMULATED = 1
PF_COMPARE_EXCHANGE_DOUBLE = 2
PF_MMX_INSTRUCTIONS_AVAILABLE = 3
PF_PPC_MOVEMEM_64BIT_OK = 4
PF_ALPHA_BYTE_INSTRUCTIONS = 5
PF_XMMI_INSTRUCTIONS_AVAILABLE = 6
PF_3DNOW_INSTRUCTIONS_AVAILABLE = 7
PF_RDTSC_INSTRUCTION_AVAILABLE = 8
PF_PAE_ENABLED = 9
PF_XMMI64_INSTRUCTIONS_AVAILABLE = 10

struct MEMORYBASICINFORMATION64
       BaseAddress dq ?
       AllocationBase dq ?
       AllocationProtect dd ?,?
       RegionSize dq ?
       State dd ?
       Protect dd ?
       Type dd ?,?
ends

SECTION_QUERY = 1
SECTION_MAP_WRITE = 2
SECTION_MAP_READ = 4
SECTION_MAP_EXECUTE = 8
SECTION_EXTEND_SIZE = 10
SECTION_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED or SECTION_QUERY or SECTION_MAP_WRITE or\
		     SECTION_MAP_READ or SECTION_MAP_EXECUTE or SECTION_EXTEND_SIZE
PAGE_NOACCESS = 1
PAGE_READONLY = 2
PAGE_READWRITE = 4
PAGE_WRITECOPY = 8
PAGE_EXECUTE = $10
PAGE_EXECUTE_READ = $20
PAGE_EXECUTE_READWRITE = $40
PAGE_EXECUTE_WRITECOPY = $80
PAGE_GUARD = $100
PAGE_NOCACHE = $200
PAGE_WRITECOMBINE = $400
MEM_COMMIT = $1000
MEM_RESERVE = $2000
MEM_DECOMMIT = $4000
MEM_RELEASE = $8000
MEM_FREE = $10000
MEM_PRIVATE = $20000
MEM_MAPPED = $40000
MEM_RESET = $80000
MEM_TOP_DOWN = $100000
MEM_WRITE_WATCH = $200000
MEM_PHYSICAL = $400000
MEM_LARGE_PAGES = $20000000
MEM_4MB_PAGES = $80000000
SEC_FILE = $800000
SEC_IMAGE = $1000000
SEC_RESERVE = $4000000
SEC_COMMIT = $8000000
SEC_NOCACHE = $10000000
SEC_LARGE_PAGES = $80000000
MEM_IMAGE = SEC_IMAGE
WRITE_WATCH_FLAG_RESET = 1

FILE_READ_DATA = 1
FILE_LIST_DIRECTORY = 1
FILE_WRITE_DATA = 2
FILE_ADD_FILE = 2
FILE_APPEND_DATA = 4
FILE_ADD_SUBDIRECTORY = 4
FILE_CREATE_PIPE_INSTANCE = 4
FILE_READ_EA = 8
FILE_WRITE_EA = 10
FILE_EXECUTE = 20
FILE_TRAVERSE = 20
FILE_DELETE_CHILD = 40
FILE_READ_ATTRIBUTES = 80
FILE_WRITE_ATTRIBUTES = 100
FILE_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or $1FF
FILE_GENERIC_READ = STANDARD_RIGHTS_READ or FILE_READ_DATA or FILE_READ_ATTRIBUTES or\
		    FILE_READ_EA or SYNCHRONIZE

FILE_GENERIC_WRITE = STANDARD_RIGHTS_WRITE or FILE_WRITE_DATA or FILE_WRITE_ATTRIBUTES or\
		     FILE_WRITE_EA or FILE_APPEND_DATA or SYNCHRONIZE

FILE_GENERIC_EXECUTE = STANDARD_RIGHTS_EXECUTE or FILE_READ_ATTRIBUTES or FILE_EXECUTE or SYNCHRONIZE

FILE_SHARE_READ = 1
FILE_SHARE_WRITE = 2
FILE_SHARE_DELETE = 4
FILE_ATTRIBUTE_READONLY = 1
FILE_ATTRIBUTE_HIDDEN = 2
FILE_ATTRIBUTE_SYSTEM = 4
FILE_ATTRIBUTE_DIRECTORY = $10
FILE_ATTRIBUTE_ARCHIVE = $20
FILE_ATTRIBUTE_DEVICE = $40
FILE_ATTRIBUTE_NORMAL = $80
FILE_ATTRIBUTE_TEMPORARY = $100
FILE_ATTRIBUTE_SPARSE_FILE = $200
FILE_ATTRIBUTE_REPARSE_POINT = $400
FILE_ATTRIBUTE_COMPRESSED = $800
FILE_ATTRIBUTE_OFFLINE = $1000
FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = $2000
FILE_ATTRIBUTE_ENCRYPTED = $4000
FILE_NOTIFY_CHANGE_FILE_NAME = 1
FILE_NOTIFY_CHANGE_DIR_NAME = 2
FILE_NOTIFY_CHANGE_ATTRIBUTES = 4
FILE_NOTIFY_CHANGE_SIZE = 8
FILE_NOTIFY_CHANGE_LAST_WRITE = $10
FILE_NOTIFY_CHANGE_LAST_ACCESS = $20
FILE_NOTIFY_CHANGE_CREATION = $40
FILE_NOTIFY_CHANGE_SECURITY = $100
FILE_ACTION_ADDED = 1
FILE_ACTION_REMOVED = 2
FILE_ACTION_MODIFIED = 3
FILE_ACTION_RENAMED_OLD_NAME = 4
FILE_ACTION_RENAMED_NEW_NAME = 5
MAILSLOT_NO_MESSAGE = -1
MAILSLOT_WAIT_FOREVER = -1
FILE_CASE_SENSITIVE_SEARCH = 1
FILE_CASE_PRESERVED_NAMES = 2
FILE_UNICODE_ON_DISK = 4
FILE_PERSISTENT_ACLS = 8
FILE_FILE_COMPRESSION = $10
FILE_VOLUME_QUOTAS = $20
FILE_SUPPORTS_SPARSE_FILES = $40
FILE_SUPPORTS_REPARSE_POINTS = $80
FILE_SUPPORTS_REMOTE_STORAGE = $100
FILE_VOLUME_IS_COMPRESSED = $8000
FILE_SUPPORTS_OBJECT_IDS = $10000
FILE_SUPPORTS_ENCRYPTION = $20000
FILE_NAMED_STREAMS = $40000
FILE_READ_ONLY_VOLUME = $80000

struct FILENOTIFYINFORMATION
       NextEntryOffset dd ?
       Action dd ?
       FileNameLength dd ?
       FileName dw ?, ?
ends

struct FILESEGMENTELEMENT
       Buffer dq ?
       Alignment dq ?
ends

struct REPARSEGUIDDATABUFFER
       ReparseTag dd ?
       ReparseDataLength dw ?
       Reserved dw ?
       ReparseGuid GUID
       DataBuffer dd ?
ends

REPARSE_GUID_DATA_BUFFER_HEADER_SIZE  equ $18
MAXIMUM_REPARSE_DATA_BUFFER_SIZE = 16 * 1024
IO_REPARSE_TAG_RESERVED_ZERO = 0
IO_REPARSE_TAG_RESERVED_ONE = 1
IO_REPARSE_TAG_RESERVED_RANGE = IO_REPARSE_TAG_RESERVED_ONE
IO_REPARSE_TAG_MOUNT_POINT = $A0000003
IO_REPARSE_TAG_HSM = $C0000004
IO_REPARSE_TAG_SIS = $80000007
IO_REPARSE_TAG_DFS = $8000000A
IO_REPARSE_TAG_FILTER_MANAGER = $8000000B
IO_COMPLETION_MODIFY_STATE = 2
IO_COMPLETION_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or $3
DUPLICATE_CLOSE_SOURCE = 1
DUPLICATE_SAME_ACCESS = 2

PowerSystemUnspecified = 0
PowerSystemWorking = 1
PowerSystemSleeping1 = 2
PowerSystemSleeping2 = 3
PowerSystemSleeping3 = 4
PowerSystemHibernate = 5
PowerSystemShutdown = 6
PowerSystemMaximum = 7

POWER_SYSTEM_MAXIMUM = 7

PowerActionNone = 0
PowerActionReserved = 1
PowerActionSleep = 2
PowerActionHibernate = 3
PowerActionShutdown = 4
PowerActionShutdownReset = 5
PowerActionShutdownOff = 6
PowerActionWarmEject = 7

PowerDeviceUnspecified = 0
PowerDeviceD0 = 1
PowerDeviceD1 = 2
PowerDeviceD2 = 3
PowerDeviceD3 = 4
PowerDeviceMaximum = 5

ES_SYSTEM_REQUIRED = 1
ES_DISPLAY_REQUIRED = 2
ES_USER_PRESENT = 4
ES_CONTINUOUS = $80000000

LT_DONT_CARE = 0
LT_LOWEST_LATENCY = 1

PDCAP_D0_SUPPORTED = 1
PDCAP_D1_SUPPORTED = 2
PDCAP_D2_SUPPORTED = 4
PDCAP_D3_SUPPORTED = 8
PDCAP_WAKE_FROM_D0_SUPPORTED = $10
PDCAP_WAKE_FROM_D1_SUPPORTED = $20
PDCAP_WAKE_FROM_D2_SUPPORTED = $40
PDCAP_WAKE_FROM_D3_SUPPORTED = $80
PDCAP_WARM_EJECT_SUPPORTED = $100

struct CMPOWERDATA
       PD_Size dd ?
       PD_MostRecentPowerState dd ?
       PD_Capabilities dd ?
       PD_D1Latency dd ?
       PD_D2Latency dd ?
       PD_D3Latency dd ?
       PD_PowerStateMapping dd PowerSystemMaximum dup(?)
       PD_DeepestSystemWake dd ?
ends

SystemPowerPolicyAc = 0
SystemPowerPolicyDc = 1
VerifySystemPolicyAc = 2
VerifySystemPolicyDc = 3
SystemPowerCapabilities = 4
SystemBatteryState = 5
SystemPowerStateHandler = 6
ProcessorStateHandler = 7
SystemPowerPolicyCurrent = 8
AdministratorPowerPolicy = 9
SystemReserveHiberFile = 10
ProcessorInformation = 11
SystemPowerInformation = 12
ProcessorStateHandler2 = 13
LastWakeTime = 14
LastSleepTime = 15
SystemExecutionState = 16
SystemPowerStateNotifyHandler = 17
ProcessorPowerPolicyAc = 18
ProcessorPowerPolicyDc = 19
VerifyProcessorPowerPolicyAc = 20
VerifyProcessorPowerPolicyDc = 21
ProcessorPowerPolicyCurrent = 22
SystemPowerStateLogging = 23
SystemPowerLoggingEntry = 24

struct BATTERYREPORTINGSCALE
       Granularity dd ?
       Capacity dd ?
ends

struct POWERACTIONPOLICY
       Action dd ?
       Flags dd ?
       EventCode dd ?
ends

POWER_ACTION_QUERY_ALLOWED = 1
POWER_ACTION_UI_ALLOWED = 2
POWER_ACTION_OVERRIDE_APPS = 4
POWER_ACTION_LIGHTEST_FIRST = $10000000
POWER_ACTION_LOCK_CONSOLE = $20000000
POWER_ACTION_DISABLE_WAKES = $40000000
POWER_ACTION_CRITICAL = $80000000

POWER_LEVEL_USER_NOTIFY_TEXT = 1
POWER_LEVEL_USER_NOTIFY_SOUND = 2
POWER_LEVEL_USER_NOTIFY_EXEC = 4
POWER_USER_NOTIFY_BUTTON = 8
POWER_USER_NOTIFY_SHUTDOWN = $10
POWER_FORCE_TRIGGER_RESET = $80000000

struct SYSTEMPOWERLEVEL
       Enable db ?
       Spare db ?,?,?
       BatteryLevel dd ?
       PowerPolicy POWERACTIONPOLICY
       MinSystemState dd ?
ends

NUM_DISCHARGE_POLICIES = 4
DISCHARGE_POLICY_CRITICAL = 0
DISCHARGE_POLICY_LOW = 1

PO_THROTTLE_NONE = 0
PO_THROTTLE_CONSTANT = 1
PO_THROTTLE_DEGRADE = 2
PO_THROTTLE_ADAPTIVE = 3
PO_THROTTLE_MAXIMUM = 4

struct SYSTEMPOWERPOLICY
       Revision dd ?
       PowerButton POWERACTIONPOLICY
       SleepButton POWERACTIONPOLICY
       LidClose POWERACTIONPOLICY
       LidOpenWake dd ?
       Reserved dd ?
       Idle POWERACTIONPOLICY
       IdleTimeout dd ?
       IdleSensitivity db ?
       DynamicThrottle db ?
       Spare2 db ?,?
       MinSleep dd ?
       MaxSleep dd ?
       ReducedLatencySleep dd ?
       WinLogonFlags dd ?
       Spare3 dd ?
       DozeS4Timeout dd ?
       BroadcastCapacityResolution dd ?
       DischargePolicy SYSTEMPOWERLEVEL
		       db (NUM_DISCHARGE_POLICIES-1) * sizeof.SYSTEMPOWERLEVEL dup(?)
       VideoTimeout dd ?
       VideoDimDisplay db ?
       VideoReserved  dd ?,?,?
       SpindownTimeout dd ?
       OptimizeForPower db ?
       FanThrottleTolerance db ?
       ForcedThrottle db ?
       MinThrottle db ?
       OverThrottled POWERACTIONPOLICY
       spare4 db ?,?,?
ends

struct PROCESSORPOWERPOLICYINFO
       TimeCheck dd ?
       DemoteLimit dd ?
       PromoteLimit dd ?
       DemotePercent db ?
       PromotePercent db ?
       Spare db ?,?
       union
	    AllowDemotion dd ?
	    AllowPromotion dd ?
	    Reserved dd ?
       ends
ends

struct PROCESSORPOWERPOLICY
       Revision dd ?
       DynamicThrottle db ?
       Spare db ?,?,?
       union
	   DisableCStates dd ?
	   Reserved dd ?
       ends
       PolicyCount dd ?
       Policy PROCESSORPOWERPOLICYINFO
	      db sizeof.PROCESSORPOWERPOLICYINFO*2 dup(?)
ends

struct ADMINISTRATORPOWERPOLICY
       MinSleep dd ?
       MaxSleep dd ?
       MinVideoTimeout dd ?
       MaxVideoTimeout dd ?
       MinSpindownTimeout dd ?
       MaxSpindownTimeout dd ?
ends

struct SYSTEMPOWERCAPABILITIES
       PowerButtonPresent db ?
       SleepButtonPresent db ?
       LidPresent db ?
       SystemS1 db ?
       SystemS2 db ?
       SystemS3 db ?
       SystemS4 db ?
       SystemS5 db ?
       HiberFilePresent db ?
       FullWake db ?
       VideoDimPresent db ?
       ApmPresent db ?
       UpsPresent db ?
       ThermalControl db ?
       ProcessorThrottle db ?
       ProcessorMinThrottle db ?
       ProcessorMaxThrottle db ?
       spare2  db ?,?,?,?
       DiskSpinDown db ?
       spare3 db 8 dup(?)
       SystemBatteriesPresent db ?
       BatteriesAreShortTerm db ?
       BatteryScale BATTERYREPORTINGSCALE
		    db 2*sizeof.BATTERYREPORTINGSCALE dup(?)
       AcOnLineWake dd ?
       SoftLidWake dd ?
       RtcWake dd ?
       MinDeviceWakeState dd ?
       DefaultLowLatencyWake dd ?
ends

struct SYSTEMBATTERYSTATE
       AcOnLine db ?
       BatteryPresent db ?
       Charging db ?
       Discharging db ?
       Spare1 db ?,?,?,?
       MaxCapacity dd ?
       RemainingCapacity dd ?
       Rate dd ?
       EstimatedTime dd ?
       DefaultAlert1 dd ?
       DefaultAlert2 dd ?
ends

IMAGE_DOS_SIGNATURE = $4D5A
IMAGE_OS2_SIGNATURE = $4E45
IMAGE_OS2_SIGNATURE_LE = $4C45
IMAGE_NT_SIGNATURE = $50450000

struct IMAGEDOSHEADER
       e_magic dw ?
       e_cblp dw ?
       e_cp dw ?
       e_crlc dw ?
       e_cparhdr dw ?
       e_minalloc dw ?
       e_maxalloc dw ?
       e_ss dw ?
       e_sp dw ?
       e_csum dw ?
       e_ip dw ?
       e_cs dw ?
       e_lfarlc dw ?
       e_ovno dw ?
       e_res dw ?,?,?,?
       e_oemid dw ?
       e_oeminfo dw ?
       e_res2 dw 10 dup(?)
       e_lfanew dd ?
ends

struct IMAGEVXDHEADER
       e32_magic dw ?
       e32_border db ?
       e32_worder db ?
       e32_level dd ?
       e32_cpu dw ?
       e32_os dw ?
       e32_ver dd ?
       e32_mflags dd ?
       e32_mpages dd ?
       e32_startobj dd ?
       e32_eip dd ?
       e32_stackobj dd ?
       e32_esp dd ?
       e32_pagesize dd ?
       e32_lastpagesize dd ?
       e32_fixupsize dd ?
       e32_fixupsum dd ?
       e32_ldrsize dd ?
       e32_ldrsum dd ?
       e32_objtab dd ?
       e32_objcnt dd ?
       e32_objmap dd ?
       e32_itermap dd ?
       e32_rsrctab dd ?
       e32_rsrccnt dd ?
       e32_restab dd ?
       e32_enttab dd ?
       e32_dirtab dd ?
       e32_dircnt dd ?
       e32_fpagetab dd ?
       e32_frectab dd ?
       e32_impmod dd ?
       e32_impmodcnt dd ?
       e32_impproc dd ?
       e32_pagesum dd ?
       e32_datapage dd ?
       e32_preload dd ?
       e32_nrestab dd ?
       e32_cbnrestab dd ?
       e32_nressum dd ?
       e32_autodata dd ?
       e32_debuginfo dd ?
       e32_debuglen dd ?
       e32_instpreload dd ?
       e32_instdemand dd ?
       e32_heapsize dd ?
       e32_res3 db 12 dup(?)
       e32_winresoff dd ?
       e32_winreslen dd ?
       e32_devid dw ?
       e32_ddkver dw ?
ends

struct IMAGEFILEHEADER
       Machine dw ?
       NumberOfSections dw ?
       TimeDateStamp dd ?
       PointerToSymbolTable dd ?
       NumberOfSymbols dd ?
       SizeOfOptionalHeader dw ?
       Characteristics dw ?
ends

IMAGE_SIZEOF_FILE_HEADER = 20
IMAGE_FILE_RELOCS_STRIPPED = 1
IMAGE_FILE_EXECUTABLE_IMAGE = 2
IMAGE_FILE_LINE_NUMS_STRIPPED = 4
IMAGE_FILE_LOCAL_SYMS_STRIPPED = 8
IMAGE_FILE_AGGRESIVE_WS_TRIM = $10
IMAGE_FILE_LARGE_ADDRESS_AWARE = $20
IMAGE_FILE_BYTES_REVERSED_LO = $80
IMAGE_FILE_32BIT_MACHINE = $100
IMAGE_FILE_DEBUG_STRIPPED = $200
IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP = $400
IMAGE_FILE_NET_RUN_FROM_SWAP = $800
IMAGE_FILE_SYSTEM = $1000
IMAGE_FILE_DLL = $2000
IMAGE_FILE_UP_SYSTEM_ONLY = $4000
IMAGE_FILE_BYTES_REVERSED_HI = $8000
IMAGE_FILE_MACHINE_UNKNOWN = $0
IMAGE_FILE_MACHINE_I386 = $14c
IMAGE_FILE_MACHINE_R3000 = $162
IMAGE_FILE_MACHINE_R4000 = $166
IMAGE_FILE_MACHINE_R10000 = $168
IMAGE_FILE_MACHINE_WCEMIPSV2 = $169
IMAGE_FILE_MACHINE_ALPHA = $184
IMAGE_FILE_MACHINE_SH3 = $1a2
IMAGE_FILE_MACHINE_SH3DSP = $1a3
IMAGE_FILE_MACHINE_SH3E = $1a4
IMAGE_FILE_MACHINE_SH4 = $1a6
IMAGE_FILE_MACHINE_SH5 = $1a8
IMAGE_FILE_MACHINE_ARM = $1c0
IMAGE_FILE_MACHINE_THUMB = $1c2
IMAGE_FILE_MACHINE_AM33 = $1d3
IMAGE_FILE_MACHINE_POWERPC = $1F0
IMAGE_FILE_MACHINE_POWERPCFP = $1f1
IMAGE_FILE_MACHINE_IA64 = $200
IMAGE_FILE_MACHINE_MIPS16 = $266
IMAGE_FILE_MACHINE_ALPHA64 = $284
IMAGE_FILE_MACHINE_MIPSFPU = $366
IMAGE_FILE_MACHINE_MIPSFPU16 = $466
IMAGE_FILE_MACHINE_AXP64 = IMAGE_FILE_MACHINE_ALPHA64
IMAGE_FILE_MACHINE_TRICORE = $520
IMAGE_FILE_MACHINE_CEF = $CEF
IMAGE_FILE_MACHINE_EBC = $EBC
IMAGE_FILE_MACHINE_AMD64 = $8664
IMAGE_FILE_MACHINE_M32R = $9041
IMAGE_FILE_MACHINE_CEE = $C0EE

; Directory format.
struct IMAGEDATADIRECTORY
       VirtualAddress dd ?
       Size dd ?
ends

IMAGE_NUMBEROF_DIRECTORY_ENTRIES = 16

struct IMAGEOPTIONALHEADER
       Magic dw ?
       MajorLinkerVersion db ?
       MinorLinkerVersion db ?
       SizeOfCode dd ?
       SizeOfInitializedData dd ?
       SizeOfUninitializedData dd ?
       AddressOfEntryPoint dd ?
       BaseOfCode dd ?
       BaseOfData dd ?
       ImageBase dd ?
       SectionAlignment dd ?
       FileAlignment dd ?
       MajorOperatingSystemVersion dw ?
       MinorOperatingSystemVersion dw ?
       MajorImageVersion dw ?
       MinorImageVersion dw ?
       MajorSubsystemVersion dw ?
       MinorSubsystemVersion dw ?
       Win32VersionValue dd ?
       SizeOfImage dd ?
       SizeOfHeaders dd ?
       CheckSum dd ?
       Subsystem dw ?
       DllCharacteristics dw ?
       SizeOfStackReserve dd ?
       SizeOfStackCommit dd ?
       SizeOfHeapReserve dd ?
       SizeOfHeapCommit dd ?
       LoaderFlags dd ?
       NumberOfRvaAndSizes dd ?
       DataDirectory IMAGEDATADIRECTORY
		     db (IMAGE_NUMBEROF_DIRECTORY_ENTRIES - 1) * sizeof.IMAGEDATADIRECTORY dup(?)
ends

struct IMAGEROMOPTIONALHEADER
       Magic dw ?
       MajorLinkerVersion db ?
       MinorLinkerVersion db ?
       SizeOfCode dd ?
       SizeOfInitializedData dd ?
       SizeOfUninitializedData dd ?
       AddressOfEntryPoint dd ?
       BaseOfCode dd ?
       BaseOfData dd ?
       BaseOfBss dd ?
       GprMask dd ?
       CprMask dd 4 dup(?)
       GpValue dd ?
ends

struct IMAGEOPTIONALHEADER64
       Magic dw ?
       MajorLinkerVersion db ?
       MinorLinkerVersion db ?
       SizeOfCode dd ?
       SizeOfInitializedData dd ?
       SizeOfUninitializedData dd ?
       AddressOfEntryPoint dd ?
       BaseOfCode dd ?
       ImageBase dq ?
       SectionAlignment dd ?
       FileAlignment dd ?
       MajorOperatingSystemVersion dw ?
       MinorOperatingSystemVersion dw ?
       MajorImageVersion dw ?
       MinorImageVersion dw ?
       MajorSubsystemVersion dw ?
       MinorSubsystemVersion dw ?
       Win32VersionValue dd ?
       SizeOfImage dd ?
       SizeOfHeaders dd ?
       CheckSum dd ?
       Subsystem dw ?
       DllCharacteristics dw ?
       SizeOfStackReserve dq ?
       SizeOfStackCommit dq ?
       SizeOfHeapReserve dq ?
       SizeOfHeapCommit dq ?
       LoaderFlags dd ?
       NumberOfRvaAndSizes dd ?
       DataDirectory IMAGEDATADIRECTORY
		     db (IMAGE_NUMBEROF_DIRECTORY_ENTRIES - 1) * sizeof.IMAGEDATADIRECTORY dup(?)
ends

IMAGE_SIZEOF_ROM_OPTIONAL_HEADER = 56
IMAGE_SIZEOF_STD_OPTIONAL_HEADER = 28
IMAGE_SIZEOF_NT_OPTIONAL32_HEADER = 224
IMAGE_SIZEOF_NT_OPTIONAL64_HEADER = 240
IMAGE_NT_OPTIONAL_HDR32_MAGIC = $10b
IMAGE_NT_OPTIONAL_HDR64_MAGIC = $20b
IMAGE_ROM_OPTIONAL_HDR_MAGIC = $107
IMAGE_SIZEOF_NT_OPTIONAL_HEADER = IMAGE_SIZEOF_NT_OPTIONAL32_HEADER
IMAGE_NT_OPTIONAL_HDR_MAGIC = IMAGE_NT_OPTIONAL_HDR32_MAGIC

struct IMAGENTHEADERS64
       Signature dd ?
       FileHeader IMAGEFILEHEADER
       OptionalHeader IMAGEOPTIONALHEADER64
ends

struct IMAGENTHEADERS
       Signature dd ?
       FileHeader IMAGEFILEHEADER
       OptionalHeader IMAGEOPTIONALHEADER
ends

struct IMAGEROMHEADERS
       FileHeader IMAGEFILEHEADER
       OptionalHeader IMAGEROMOPTIONALHEADER
ends

; Subsystem Values
IMAGE_SUBSYSTEM_UNKNOWN = 0
IMAGE_SUBSYSTEM_NATIVE = 1
IMAGE_SUBSYSTEM_WINDOWS_GUI = 2
IMAGE_SUBSYSTEM_WINDOWS_CUI = 3
IMAGE_SUBSYSTEM_OS2_CUI = 5
IMAGE_SUBSYSTEM_POSIX_CUI = 7
IMAGE_SUBSYSTEM_NATIVE_WINDOWS = 8
IMAGE_SUBSYSTEM_WINDOWS_CE_GUI = 9
IMAGE_SUBSYSTEM_EFI_APPLICATION = 10
IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER = 11
IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER = 12
IMAGE_SUBSYSTEM_EFI_ROM = 13
IMAGE_SUBSYSTEM_XBOX = 14

; DllCharacteristics Entries
IMAGE_DLLCHARACTERISTICS_NO_ISOLATION = $200
IMAGE_DLLCHARACTERISTICS_NO_SEH = $400
IMAGE_DLLCHARACTERISTICS_NO_BIND = $800
IMAGE_DLLCHARACTERISTICS_WDM_DRIVER = $2000
IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE = $8000

; Directory Entries
IMAGE_DIRECTORY_ENTRY_EXPORT = 0
IMAGE_DIRECTORY_ENTRY_IMPORT = 1
IMAGE_DIRECTORY_ENTRY_RESOURCE = 2
IMAGE_DIRECTORY_ENTRY_EXCEPTION = 3
IMAGE_DIRECTORY_ENTRY_SECURITY = 4
IMAGE_DIRECTORY_ENTRY_BASERELOC = 5
IMAGE_DIRECTORY_ENTRY_DEBUG = 6
IMAGE_DIRECTORY_ENTRY_ARCHITECTURE = 7
IMAGE_DIRECTORY_ENTRY_GLOBALPTR = 8
IMAGE_DIRECTORY_ENTRY_TLS = 9
IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG = 10
IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT = 11
IMAGE_DIRECTORY_ENTRY_IAT = 12
IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT = 13
IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR = 14

; Non-COFF Object file header
struct ANONOBJECTHEADER
       Sig1 dw ?
       Sig2 dw ?
       Version dw ?
       Machine dw ?
       TimeDateStamp dd ?
       ClassID GUID
       SizeOfData dd ?
ends

; Section header format.
IMAGE_SIZEOF_SHORT_NAME = 8

struct IMAGESECTIONHEADER
       Name db IMAGE_SIZEOF_SHORT_NAME dup(?)
       union
	   PhysicalAddress dd ?
	   VirtualSize dd ?
       ends
       VirtualAddress dd ?
       SizeOfRawData dd ?
       PointerToRawData dd ?
       PointerToRelocations dd ?
       PointerToLinenumbers dd ?
       NumberOfRelocations dw ?
       NumberOfLinenumbers dw ?
       Characteristics dd ?
ends

IMAGE_SIZEOF_SECTION_HEADER = 40
IMAGE_SCN_TYPE_NO_PAD = $8
IMAGE_SCN_CNT_CODE = $20
IMAGE_SCN_CNT_INITIALIZED_DATA = $40
IMAGE_SCN_CNT_UNINITIALIZED_DATA = $80
IMAGE_SCN_LNK_OTHER = $100
IMAGE_SCN_LNK_INFO = $200
IMAGE_SCN_LNK_REMOVE = $800
IMAGE_SCN_LNK_COMDAT = $1000
IMAGE_SCN_NO_DEFER_SPEC_EXC = $4000
IMAGE_SCN_GPREL = $8000
IMAGE_SCN_MEM_FARDATA = $8000
IMAGE_SCN_MEM_PURGEABLE = $20000
IMAGE_SCN_MEM_16BIT = $20000
IMAGE_SCN_MEM_LOCKED = $40000
IMAGE_SCN_MEM_PRELOAD = $80000
IMAGE_SCN_ALIGN_1BYTES = $100000
IMAGE_SCN_ALIGN_2BYTES = $200000
IMAGE_SCN_ALIGN_4BYTES = $300000
IMAGE_SCN_ALIGN_8BYTES = $400000
IMAGE_SCN_ALIGN_16BYTES = $500000
IMAGE_SCN_ALIGN_32BYTES = $600000
IMAGE_SCN_ALIGN_64BYTES = $700000
IMAGE_SCN_ALIGN_128BYTES = $800000
IMAGE_SCN_ALIGN_256BYTES = $900000
IMAGE_SCN_ALIGN_512BYTES = $A00000
IMAGE_SCN_ALIGN_1024BYTES = $B00000
IMAGE_SCN_ALIGN_2048BYTES = $C00000
IMAGE_SCN_ALIGN_4096BYTES = $D00000
IMAGE_SCN_ALIGN_8192BYTES = $E00000
IMAGE_SCN_ALIGN_MASK = $F00000
IMAGE_SCN_LNK_NRELOC_OVFL = $1000000
IMAGE_SCN_MEM_DISCARDABLE = $2000000
IMAGE_SCN_MEM_NOT_CACHED = $4000000
IMAGE_SCN_MEM_NOT_PAGED = $8000000
IMAGE_SCN_MEM_SHARED = $10000000
IMAGE_SCN_MEM_EXECUTE = $20000000
IMAGE_SCN_MEM_READ = $40000000
IMAGE_SCN_MEM_WRITE = $80000000

IMAGE_SCN_SCALE_INDEX = $1

struct IMAGESYMBOL
       union
	   ShortName db 8 dup(?)
	   struct
	       Short dd ?
	       Long dd ?
	   ends
	   LongName dd ?,?
       ends
       Value dd ?
       SectionNumber dw ?
       Type dw ?
       StorageClass db ?
       NumberOfAuxSymbols db ?
ends

IMAGE_SIZEOF_SYMBOL = 18
IMAGE_SYM_UNDEFINED = 0
IMAGE_SYM_ABSOLUTE = -1
IMAGE_SYM_DEBUG = -2
IMAGE_SYM_SECTION_MAX = $FEFF
IMAGE_SYM_TYPE_NULL = 0
IMAGE_SYM_TYPE_VOID = 1
IMAGE_SYM_TYPE_CHAR = 2
IMAGE_SYM_TYPE_SHORT = 3
IMAGE_SYM_TYPE_INT = 4
IMAGE_SYM_TYPE_LONG = 5
IMAGE_SYM_TYPE_FLOAT = 6
IMAGE_SYM_TYPE_DOUBLE = 7
IMAGE_SYM_TYPE_STRUCT = 8
IMAGE_SYM_TYPE_UNION = 9
IMAGE_SYM_TYPE_ENUM = $A
IMAGE_SYM_TYPE_MOE = $B
IMAGE_SYM_TYPE_BYTE = $C
IMAGE_SYM_TYPE_WORD = $D
IMAGE_SYM_TYPE_UINT = $E
IMAGE_SYM_TYPE_DWORD = $F
IMAGE_SYM_TYPE_PCODE = $8000
IMAGE_SYM_DTYPE_NULL = 0
IMAGE_SYM_DTYPE_POINTER = 1
IMAGE_SYM_DTYPE_FUNCTION = 2
IMAGE_SYM_DTYPE_ARRAY = 3
IMAGE_SYM_CLASS_END_OF_FUNCTION = -1
IMAGE_SYM_CLASS_NULL = 0
IMAGE_SYM_CLASS_AUTOMATIC = 1
IMAGE_SYM_CLASS_EXTERNAL = 2
IMAGE_SYM_CLASS_STATIC = 3
IMAGE_SYM_CLASS_REGISTER = 4
IMAGE_SYM_CLASS_EXTERNAL_DEF = 5
IMAGE_SYM_CLASS_LABEL = 6
IMAGE_SYM_CLASS_UNDEFINED_LABEL = 7
IMAGE_SYM_CLASS_MEMBER_OF_STRUCT = 8
IMAGE_SYM_CLASS_ARGUMENT = 9
IMAGE_SYM_CLASS_STRUCT_TAG = $A
IMAGE_SYM_CLASS_MEMBER_OF_UNION = $B
IMAGE_SYM_CLASS_UNION_TAG = $C
IMAGE_SYM_CLASS_TYPE_DEFINITION = $D
IMAGE_SYM_CLASS_UNDEFINED_STATIC = $E
IMAGE_SYM_CLASS_ENUM_TAG = $F
IMAGE_SYM_CLASS_MEMBER_OF_ENUM = $10
IMAGE_SYM_CLASS_REGISTER_PARAM = $11
IMAGE_SYM_CLASS_BIT_FIELD = $12
IMAGE_SYM_CLASS_FAR_EXTERNAL = $44
IMAGE_SYM_CLASS_BLOCK = $64
IMAGE_SYM_CLASS_FUNCTION = $65
IMAGE_SYM_CLASS_END_OF_STRUCT = $66
IMAGE_SYM_CLASS_FILE = $67
IMAGE_SYM_CLASS_SECTION = $68
IMAGE_SYM_CLASS_WEAK_EXTERNAL = $69
IMAGE_SYM_CLASS_CLR_TOKEN = $6B

; type packing constants
N_BTMASK = $F
N_TMASK = $30
N_TMASK1 = $C0
N_TMASK2 = $F0
N_BTSHFT = 4
N_TSHIFT = 2

struct IMAGEAUXSYMBOLTOKENDEF
       bAuxType db ?
       bReserved db ?
       SymbolTableIndex dd ?
       rgbReserved db 12 dup(?)
ends

; Auxiliary entry format.
struct IMAGEAUXSYMBOL
       union
	   union
	       TagIndex dd ?
	       union
		   union
		       Linenumber dw ?
		       Size dw ?
		   ends
		   TotalSize dd ?
	       ends
	       union
		   union
		       PointerToLinenumber dd ?
		       PointerToNextFunction dd ?
		   ends
		   union
		       Dimension dw 4 dup(?)
		   ends
	       ends
	       TvIndex dw ?
	   ends
	   union
	       Name db IMAGE_SIZEOF_SYMBOL dup(?)
	   ends
	   union
	       Length dd ?
	       NumberOfRelocations dw ?
	       NumberOfLinenumbers dw ?
	       checkSum dd ?
	       Number dw ?
	       Selection db ?
	       bReserved db ?
	       HighNumber dw ?
	   ends

	   TokenDef IMAGEAUXSYMBOLTOKENDEF

	   union
	       crc dd ?
	       rgbReserved db 14 dup(?)
	   ends
       ends
ends

IMAGE_SIZEOF_AUX_SYMBOL = 18
IMAGE_AUX_SYMBOL_TYPE_TOKEN_DEF = 1

; Communal selection types.
IMAGE_COMDAT_SELECT_NODUPLICATES = 1
IMAGE_COMDAT_SELECT_ANY = 2
IMAGE_COMDAT_SELECT_SAME_SIZE = 3
IMAGE_COMDAT_SELECT_EXACT_MATCH = 4
IMAGE_COMDAT_SELECT_ASSOCIATIVE = 5
IMAGE_COMDAT_SELECT_LARGEST = 6
IMAGE_COMDAT_SELECT_NEWEST = 7
IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY = 1
IMAGE_WEAK_EXTERN_SEARCH_LIBRARY = 2
IMAGE_WEAK_EXTERN_SEARCH_ALIAS = 3

; Relocation format.
struct IMAGERELOCATION
       union
	   VirtualAddress dd ?
	   RelocCount dd ?
       ends
       SymbolTableIndex dd ?
       Type dw ?
ends

IMAGE_SIZEOF_RELOCATION = 10

; I386 relocation types.
IMAGE_REL_I386_ABSOLUTE = 0
IMAGE_REL_I386_DIR16 = 1
IMAGE_REL_I386_REL16 = 2
IMAGE_REL_I386_DIR32 = 6
IMAGE_REL_I386_DIR32NB = 7
IMAGE_REL_I386_SEG12 = 9
IMAGE_REL_I386_SECTION = $A
IMAGE_REL_I386_SECREL = $B
IMAGE_REL_I386_TOKEN = $C
IMAGE_REL_I386_SECREL7 = $D
IMAGE_REL_I386_REL32 = $14

; MIPS relocation types.
IMAGE_REL_MIPS_ABSOLUTE = 0
IMAGE_REL_MIPS_REFHALF = 1
IMAGE_REL_MIPS_REFWORD = 2
IMAGE_REL_MIPS_JMPADDR = 3
IMAGE_REL_MIPS_REFHI = 4
IMAGE_REL_MIPS_REFLO = 5
IMAGE_REL_MIPS_GPREL = 6
IMAGE_REL_MIPS_LITERAL = 7
IMAGE_REL_MIPS_SECTION = $A
IMAGE_REL_MIPS_SECREL = $B
IMAGE_REL_MIPS_SECRELLO = $C
IMAGE_REL_MIPS_SECRELHI = $D
IMAGE_REL_MIPS_TOKEN = $E
IMAGE_REL_MIPS_JMPADDR16 = $10
IMAGE_REL_MIPS_REFWORDNB = $22
IMAGE_REL_MIPS_PAIR = $25

; Alpha Relocation types.
IMAGE_REL_ALPHA_ABSOLUTE = 0
IMAGE_REL_ALPHA_REFLONG = 1
IMAGE_REL_ALPHA_REFQUAD = 2
IMAGE_REL_ALPHA_GPREL32 = 3
IMAGE_REL_ALPHA_LITERAL = 4
IMAGE_REL_ALPHA_LITUSE = 5
IMAGE_REL_ALPHA_GPDISP = 6
IMAGE_REL_ALPHA_BRADDR = 7
IMAGE_REL_ALPHA_HINT = 8
IMAGE_REL_ALPHA_INLINE_REFLONG = 9
IMAGE_REL_ALPHA_REFHI = $A
IMAGE_REL_ALPHA_REFLO = $B
IMAGE_REL_ALPHA_PAIR = $C
IMAGE_REL_ALPHA_MATCH = $D
IMAGE_REL_ALPHA_SECTION = $E
IMAGE_REL_ALPHA_SECREL = $F
IMAGE_REL_ALPHA_REFLONGNB = $10
IMAGE_REL_ALPHA_SECRELLO = $11
IMAGE_REL_ALPHA_SECRELHI = $12
IMAGE_REL_ALPHA_REFQ3 = $13
IMAGE_REL_ALPHA_REFQ2 = $14
IMAGE_REL_ALPHA_REFQ1 = $15
IMAGE_REL_ALPHA_GPRELLO = $16
IMAGE_REL_ALPHA_GPRELHI = $17

; IBM PowerPC relocation types.
IMAGE_REL_PPC_ABSOLUTE = 0
IMAGE_REL_PPC_ADDR64 = 1
IMAGE_REL_PPC_ADDR32 = 2
IMAGE_REL_PPC_ADDR24 = 3
IMAGE_REL_PPC_ADDR16 = 4
IMAGE_REL_PPC_ADDR14 = 5
IMAGE_REL_PPC_REL24 = 6
IMAGE_REL_PPC_REL14 = 7
IMAGE_REL_PPC_TOCREL16 = 8
IMAGE_REL_PPC_TOCREL14 = 9
IMAGE_REL_PPC_ADDR32NB = $A
IMAGE_REL_PPC_SECREL = $B
IMAGE_REL_PPC_SECTION = $C
IMAGE_REL_PPC_IFGLUE = $D
IMAGE_REL_PPC_IMGLUE = $E
IMAGE_REL_PPC_SECREL16 = $F
IMAGE_REL_PPC_REFHI = $10
IMAGE_REL_PPC_REFLO = $11
IMAGE_REL_PPC_PAIR = $12
IMAGE_REL_PPC_SECRELLO = $13
IMAGE_REL_PPC_SECRELHI = $14
IMAGE_REL_PPC_GPREL = $15
IMAGE_REL_PPC_TOKEN = $16
IMAGE_REL_PPC_TYPEMASK = $FF

; Flag bits in IMAGE_RELOCATION.TYPE
IMAGE_REL_PPC_NEG = $100
IMAGE_REL_PPC_BRTAKEN = $200
IMAGE_REL_PPC_BRNTAKEN = $400
IMAGE_REL_PPC_TOCDEFN = $800

; Hitachi SH3 relocation types.
IMAGE_REL_SH3_ABSOLUTE = 0
IMAGE_REL_SH3_DIRECT16 = 1
IMAGE_REL_SH3_DIRECT32 = 2
IMAGE_REL_SH3_DIRECT8 = 3
IMAGE_REL_SH3_DIRECT8_WORD = 4
IMAGE_REL_SH3_DIRECT8_LONG = 5
IMAGE_REL_SH3_DIRECT4 = 6
IMAGE_REL_SH3_DIRECT4_WORD = 7
IMAGE_REL_SH3_DIRECT4_LONG = 8
IMAGE_REL_SH3_PCREL8_WORD = 9
IMAGE_REL_SH3_PCREL8_LONG = $A
IMAGE_REL_SH3_PCREL12_WORD = $B
IMAGE_REL_SH3_STARTOF_SECTION = $C
IMAGE_REL_SH3_SIZEOF_SECTION = $D
IMAGE_REL_SH3_SECTION = $E
IMAGE_REL_SH3_SECREL = $F
IMAGE_REL_SH3_DIRECT32_NB = $10
IMAGE_REL_SH3_GPREL4_LONG = $11
IMAGE_REL_SH3_TOKEN = $12
IMAGE_REL_ARM_ABSOLUTE = 0
IMAGE_REL_ARM_ADDR32 = 1
IMAGE_REL_ARM_ADDR32NB = 2
IMAGE_REL_ARM_BRANCH24 = 3
IMAGE_REL_ARM_BRANCH11 = 4
IMAGE_REL_ARM_TOKEN = 5
IMAGE_REL_ARM_GPREL12 = 6
IMAGE_REL_ARM_GPREL7 = 7
IMAGE_REL_ARM_BLX24 = 8
IMAGE_REL_ARM_BLX11 = 9
IMAGE_REL_ARM_SECTION = $E
IMAGE_REL_ARM_SECREL = $F
IMAGE_REL_AM_ABSOLUTE = 0
IMAGE_REL_AM_ADDR32 = 1
IMAGE_REL_AM_ADDR32NB = 2
IMAGE_REL_AM_CALL32 = 3
IMAGE_REL_AM_FUNCINFO = 4
IMAGE_REL_AM_REL32_1 = 5
IMAGE_REL_AM_REL32_2 = 6
IMAGE_REL_AM_SECREL = 7
IMAGE_REL_AM_SECTION = 8
IMAGE_REL_AM_TOKEN = 9

; X86-64 relocations
IMAGE_REL_AMD64_ABSOLUTE = 0
IMAGE_REL_AMD64_ADDR64 = 1
IMAGE_REL_AMD64_ADDR32 = 2
IMAGE_REL_AMD64_ADDR32NB = 3
IMAGE_REL_AMD64_REL32 = 4
IMAGE_REL_AMD64_REL32_1 = 5
IMAGE_REL_AMD64_REL32_2 = 6
IMAGE_REL_AMD64_REL32_3 = 7
IMAGE_REL_AMD64_REL32_4 = 8
IMAGE_REL_AMD64_REL32_5 = 9
IMAGE_REL_AMD64_SECTION = $A
IMAGE_REL_AMD64_SECREL = $B
IMAGE_REL_AMD64_SECREL7 = $C
IMAGE_REL_AMD64_TOKEN = $D
IMAGE_REL_AMD64_SREL32 = $E
IMAGE_REL_AMD64_PAIR = $F
IMAGE_REL_AMD64_SSPAN32 = $10

; IA64 relocation types.
IMAGE_REL_IA64_ABSOLUTE = 0
IMAGE_REL_IA64_IMM14 = 1
IMAGE_REL_IA64_IMM22 = 2
IMAGE_REL_IA64_IMM64 = 3
IMAGE_REL_IA64_DIR32 = 4
IMAGE_REL_IA64_DIR64 = 5
IMAGE_REL_IA64_PCREL21B = 6
IMAGE_REL_IA64_PCREL21M = 7
IMAGE_REL_IA64_PCREL21F = 8
IMAGE_REL_IA64_GPREL22 = 9
IMAGE_REL_IA64_LTOFF22 = $A
IMAGE_REL_IA64_SECTION = $B
IMAGE_REL_IA64_SECREL22 = $C
IMAGE_REL_IA64_SECREL64I = $D
IMAGE_REL_IA64_SECREL32 = $E
IMAGE_REL_IA64_DIR32NB = $10
IMAGE_REL_IA64_SREL14 = $11
IMAGE_REL_IA64_SREL22 = $12
IMAGE_REL_IA64_SREL32 = $13
IMAGE_REL_IA64_UREL32 = $14
IMAGE_REL_IA64_PCREL6$ = $15
IMAGE_REL_IA64_PCREL60B = $16
IMAGE_REL_IA64_PCREL60F = $17
IMAGE_REL_IA64_PCREL60I = $18
IMAGE_REL_IA64_PCREL60M = $19
IMAGE_REL_IA64_IMMGPREL64 = $1A
IMAGE_REL_IA64_TOKEN = $1B
IMAGE_REL_IA64_GPREL32 = $1C
IMAGE_REL_IA64_ADDEND = $1F

; CEF relocation types.
IMAGE_REL_CEF_ABSOLUTE = 0
IMAGE_REL_CEF_ADDR32 = 1
IMAGE_REL_CEF_ADDR64 = 2
IMAGE_REL_CEF_ADDR32NB = 3
IMAGE_REL_CEF_SECTION = 4
IMAGE_REL_CEF_SECREL = 5
IMAGE_REL_CEF_TOKEN = 6

; clr relocation types.
IMAGE_REL_CEE_ABSOLUTE = 0
IMAGE_REL_CEE_ADDR32 = 1
IMAGE_REL_CEE_ADDR64 = 2
IMAGE_REL_CEE_ADDR32NB = 3
IMAGE_REL_CEE_SECTION = 4
IMAGE_REL_CEE_SECREL = 5
IMAGE_REL_CEE_TOKEN = 6
IMAGE_REL_M32R_ABSOLUTE = 0
IMAGE_REL_M32R_ADDR32 = 1
IMAGE_REL_M32R_ADDR32NB = 2
IMAGE_REL_M32R_ADDR24 = 3
IMAGE_REL_M32R_GPREL16 = 4
IMAGE_REL_M32R_PCREL24 = 5
IMAGE_REL_M32R_PCREL16 = 6
IMAGE_REL_M32R_PCREL8 = 7
IMAGE_REL_M32R_REFHALF = 8
IMAGE_REL_M32R_REFHI = 9
IMAGE_REL_M32R_REFLO = $A
IMAGE_REL_M32R_PAIR = $B
IMAGE_REL_M32R_SECTION = $C
IMAGE_REL_M32R_SECREL32 = $D
IMAGE_REL_M32R_TOKEN = $E

EMARCH_ENC_I17_IMM7B_INST_WORD_X = 3
EMARCH_ENC_I17_IMM7B_SIZE_X = 7
EMARCH_ENC_I17_IMM7B_INST_WORD_POS_X = 4
EMARCH_ENC_I17_IMM7B_VAL_POS_X = 0
EMARCH_ENC_I17_IMM9D_INST_WORD_X = 3
EMARCH_ENC_I17_IMM9D_SIZE_X = 9
EMARCH_ENC_I17_IMM9D_INST_WORD_POS_X = 18
EMARCH_ENC_I17_IMM9D_VAL_POS_X = 7
EMARCH_ENC_I17_IMM5C_INST_WORD_X = 3
EMARCH_ENC_I17_IMM5C_SIZE_X = 5
EMARCH_ENC_I17_IMM5C_INST_WORD_POS_X = 13
EMARCH_ENC_I17_IMM5C_VAL_POS_X = 16
EMARCH_ENC_I17_IC_INST_WORD_X = 3
EMARCH_ENC_I17_IC_SIZE_X = 1
EMARCH_ENC_I17_IC_INST_WORD_POS_X = 12
EMARCH_ENC_I17_IC_VAL_POS_X = 21
EMARCH_ENC_I17_IMM41a_INST_WORD_X = 1
EMARCH_ENC_I17_IMM41a_SIZE_X = 10
EMARCH_ENC_I17_IMM41a_INST_WORD_POS_X = 14
EMARCH_ENC_I17_IMM41a_VAL_POS_X = 22
EMARCH_ENC_I17_IMM41b_INST_WORD_X = 1
EMARCH_ENC_I17_IMM41b_SIZE_X = 8
EMARCH_ENC_I17_IMM41b_INST_WORD_POS_X = 24
EMARCH_ENC_I17_IMM41b_VAL_POS_X = 32
EMARCH_ENC_I17_IMM41c_INST_WORD_X = 2
EMARCH_ENC_I17_IMM41c_SIZE_X = 23
EMARCH_ENC_I17_IMM41c_INST_WORD_POS_X = 0
EMARCH_ENC_I17_IMM41c_VAL_POS_X = 40
EMARCH_ENC_I17_SIGN_INST_WORD_X = 3
EMARCH_ENC_I17_SIGN_SIZE_X = 1
EMARCH_ENC_I17_SIGN_INST_WORD_POS_X = 27
EMARCH_ENC_I17_SIGN_VAL_POS_X = 63

; Line number format.
struct IMAGELINENUMBER
       union
	   SymbolTableIndex dd ?
	   VirtualAddress dd ?
       ends
       Linenumber dw ?
ends

IMAGE_SIZEOF_LINENUMBER = 6

; Based relocation format.
struct IMAGEBASERELOCATION
       VirtualAddress dd ?
       SizeOfBlock dd ?
ends

IMAGE_SIZEOF_BASE_RELOCATION = 8
IMAGE_REL_BASED_ABSOLUTE = 0
IMAGE_REL_BASED_HIGH = 1
IMAGE_REL_BASED_LOW = 2
IMAGE_REL_BASED_HIGHLOW = 3
IMAGE_REL_BASED_HIGHADJ = 4
IMAGE_REL_BASED_MIPS_JMPADDR = 5
IMAGE_REL_BASED_MIPS_JMPADDR16v = 9
IMAGE_REL_BASED_IA64_IMM64 = 9
IMAGE_REL_BASED_DIR64 = 10
IMAGE_ARCHIVE_START_SIZE = 8
IMAGE_ARCHIVE_START equ "!<arch>\n"
IMAGE_ARCHIVE_END equ "`\n"
IMAGE_ARCHIVE_PAD equ "\n"
IMAGE_ARCHIVE_LINKER_MEMBER equ "/               "
IMAGE_ARCHIVE_LONGNAMES_MEMBER equ ";              "

struct IMAGEARCHIVEMEMBERHEADER
       Name db 16 dup(?)
       Date db 12 dup(?)
       UserID db 6 dup(?)
       GroupID db 6 dup(?)
       Mode db 8 dup(?)
       Size db 10 dup(?)
       EndHeader db 2 dup(?)
ends

IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR = 60

struct IMAGEEXPORTDIRECTORY
       Characteristics dd ?
       TimeDateStamp dd ?
       MajorVersion dw ?
       MinorVersion dw ?
       Name dd ?
       Base dd ?
       NumberOfFunctions dd ?
       NumberOfNames dd ?
       AddressOfFunctions dd ?
       AddressOfNames dd ?
       AddressOfNameOrdinals dd ?
ends

struct IMAGEIMPORTBYNAME
       Hint dw ?
       Name db ?,?
ends

struct IMAGETHUNKDATA64
       union
	   ForwarderString dq ?
	   Function dq ?
	   Ordinal dq ?
	   AddressOfData dq ?
       ends
ends

struct IMAGETHUNKDATA32
       union
	   ForwarderString dd ?
	   Function dd ?
	   Ordinal dd ?
	   AddressOfData dd ?
       ends
ends

IMAGE_ORDINAL_FLAG64 = $8000000000000000
IMAGE_ORDINAL_FLAG32 = $80000000

struct IMAGETLSDIRECTORY64
       StartAddressOfRawData dq ?
       EndAddressOfRawData dq ?
       AddressOfIndex dq ?
       AddressOfCallBacks dq ?
       SizeOfZeroFill dd ?
       Characteristics dd ?
ends

struct IMAGETLSDIRECTORY32
       StartAddressOfRawData dd ?
       EndAddressOfRawData dd ?
       AddressOfIndex dd ?
       AddressOfCallBacks dd ?
       SizeOfZeroFill dd ?
       Characteristics dd ?
ends

struct IMAGEIMPORTDESCRIPTOR
       union
	   Characteristics  dd ?
	   OriginalFirstThunk dd ?
       ends
       TimeDateStamp dd ?
       ForwarderChain dd ?
       Name dd ?
       FirstThunk dd ?
ends

struct IMAGEBOUNDIMPORTDESCRIPTOR
       TimeDateStamp dd ?
       OffsetModuleName dw ?
       NumberOfModuleForwarderRefs dw ?
ends

struct IMAGEBOUNDFORWARDERREF
       TimeDateStamp dd ?
       OffsetModuleName dw ?
       Reserved dw ?
ends

struct IMAGERESOURCEDIRECTORY
       Characteristics dd ?
       TimeDateStamp dd ?
       MajorVersion dw ?
       MinorVersion dw ?
       NumberOfNamedEntries dw ?
       NumberOfIdEntries dw ?
ends

IMAGE_RESOURCE_NAME_IS_STRING = $80000000
IMAGE_RESOURCE_DATA_IS_DIRECTORY = $80000000

struct IMAGERESOURCEDIRECTORYENTRY
       union
	   union
	       NameOffset dd ?
	       NameIsString dd ?
	   ends;
	   Name dd ?
	   Id dw ?
       ends;
       union
	   OffsetToData dd ?
	   union
	       OffsetToDirectory dd ?
	       DataIsDirectory dd ?
	   ends;
       ends;
ends

struct IMAGERESOURCEDIRECTORYSTRING
       Length dw ?
       NameString db ?,?
ends

struct IMAGERESOURCEDIRSTRINGU
       Length dw ?
       NameString dw ?,?
ends

struct IMAGERESOURCEDATAENTRY
       OffsetToData dd ?
       Size dd ?
       CodePage dd ?
       Reserved dd ?
ends

struct IMAGELOADCONFIGDIRECTORY32
       Size dd ?
       TimeDateStamp dd ?
       MajorVersion dw ?
       MinorVersion dw ?
       GlobalFlagsClear dd ?
       GlobalFlagsSet dd ?
       CriticalSectionDefaultTimeout dd ?
       DeCommitFreeBlockThreshold dd ?
       DeCommitTotalFreeThreshold dd ?
       LockPrefixTable dd ?
       MaximumAllocationSize dd ?
       VirtualMemoryThreshold dd ?
       ProcessHeapFlags dd ?
       ProcessAffinityMask dd ?
       CSDVersion dw ?
       Reserved1 dw ?
       EditList dd ?
       SecurityCookie dd ?
       SEHandlerTable dd ?
       SEHandlerCount dd ?
ends

struct IMAGELOADCONFIGDIRECTORY64
       Size dd ?
       TimeDateStamp dd ?
       MajorVersion dw ?
       MinorVersion dw ?
       GlobalFlagsClear dd ?
       GlobalFlagsSet dd ?
       CriticalSectionDefaultTimeout dd ?
       DeCommitFreeBlockThreshold dq ?
       DeCommitTotalFreeThreshold dq ?
       LockPrefixTable dq ?
       MaximumAllocationSize dq ?
       VirtualMemoryThreshold dq ?
       ProcessAffinityMask dq ?
       ProcessHeapFlags dd ?
       CSDVersion dw ?
       Reserved1 dw ?
       EditList dq ?
       SecurityCookie dq ?
       SEHandlerTable dq ?
       SEHandlerCount dq ?
ends

struct IMAGECERUNTIMEFUNCTIONENTRY
       FuncStart dd ?
       union
	   PrologLen dd ?
	   FuncLen dd ?
	   ThirtyTwoBit dd ?
	   ExceptionFlag dd ?
       ends
ends

struct IMAGEALPHA64RUNTIMEFUNCTIONENTRY
       BeginAddress dq ?
       EndAddress dq ?
       ExceptionHandler dq ?
       HandlerData dq ?
       PrologEndAddress dq ?
ends

struct IMAGEALPHARUNTIMEFUNCTIONENTRY
       BeginAddress dd ?
       EndAddress dd ?
       ExceptionHandler dd ?
       HandlerData dd ?
       PrologEndAddress dd ?
ends

struct IMAGERUNTIMEFUNCTIONENTRY
       BeginAddress dd ?
       EndAddress dd ?
       UnwindInfoAddress dd ?
ends

struct IMAGEDEBUGDIRECTORY
       Characteristics dd ?
       TimeDateStamp dd ?
       MajorVersion dw ?
       MinorVersion dw ?
       Type dd ?
       SizeOfData dd ?
       AddressOfRawData dd ?
       PointerToRawData dd ?
ends

IMAGE_DEBUG_TYPE_UNKNOWN = 0
IMAGE_DEBUG_TYPE_COFF = 1
IMAGE_DEBUG_TYPE_CODEVIEW = 2
IMAGE_DEBUG_TYPE_FPO = 3
IMAGE_DEBUG_TYPE_MISC = 4
IMAGE_DEBUG_TYPE_EXCEPTION = 5
IMAGE_DEBUG_TYPE_FIXUP = 6
IMAGE_DEBUG_TYPE_OMAP_TO_SRC = 7
IMAGE_DEBUG_TYPE_OMAP_FROM_SRC = 8
IMAGE_DEBUG_TYPE_BORLAND = 9
IMAGE_DEBUG_TYPE_RESERVED10 = 10
IMAGE_DEBUG_TYPE_CLSID = 11

struct IMAGECOFFSYMBOLSHEADER
       NumberOfSymbols dd ?
       LvaToFirstSymbol dd ?
       NumberOfLinenumbers dd ?
       LvaToFirstLinenumber dd ?
       RvaToFirstByteOfCode dd ?
       RvaToLastByteOfCode dd ?
       RvaToFirstByteOfData dd ?
       RvaToLastByteOfData dd ?
ends

FRAME_FPO = 0
FRAME_TRAP = 1
FRAME_TSS = 2
FRAME_NONFPO = 3

struct FPODATA
       ulOffStart dd ?
       cbProcSize dd ?
       cdwLocals dd ?
       cdwParams dw ?
       union
	   cbProlog dw ?
	   cbRegs dw ?
	   fHasSEH dw ?
	   fUseBP dw ?
	   reserved dw ?
	   cbFrame dw ?
       ends
ends

SIZEOF_RFPO_DATA = 16
IMAGE_DEBUG_MISC_EXENAME = 1

struct IMAGEDEBUGMISC
       DataType dd ?
       Length dd ?
       Unicode db ?
       Reserved db ?,?,?
       Data db ?
ends

struct IMAGEFUNCTIONENTRY
       StartingAddress dd ?
       EndingAddress dd ?
       EndOfPrologue dd ?
ends

struct IMAGEFUNCTIONENTRY64
       StartingAddress dq ?
       EndingAddress dq ?
       union
	   EndOfPrologue dq ?
	   UnwindInfoAddress dq ?
       ends
ends

struct IMAGESEPARATEDEBUGHEADER
       Signature dw ?
       Flags dw ?
       Machine dw ?
       Characteristics dw ?
       TimeDateStamp dd ?
       CheckSum dd ?
       ImageBase dd ?
       SizeOfImage dd ?
       NumberOfSections dd ?
       ExportedNamesSize dd ?
       DebugDirectorySize dd ?
       SectionAlignment dd ?
       Reserved dd ?,?
ends

struct NONPAGEDDEBUGINFO
       Signature dw ?
       Flags dw ?
       Size dd ?
       Machine dw ?
       Characteristics dw ?
       TimeDateStamp dd ?
       CheckSum dd ?
       SizeOfImage dd ?
       ImageBase dq ?
ends

IMAGE_SEPARATE_DEBUG_SIGNATURE = $4449
NON_PAGED_DEBUG_SIGNATURE = $4E49
IMAGE_SEPARATE_DEBUG_FLAGS_MASK = $8000
IMAGE_SEPARATE_DEBUG_MISMATCH = $8000

struct IMAGEARCHITECTUREHEADER
       union
	   AmaskValue dd ?
	   AmaskShift dd ?
	   Hint dd ?
       ends
       FirstEntryRVA dd ?
ends

struct IMAGEARCHITECTUREENTRY
       FixupInstRVA dd ?
       NewInst dd ?
ends

IMPORT_OBJECT_HDR_SIG2 = $ffff

struct IMPORTOBJECTHEADER
       Sig1 dw ?
       Sig2 dw ?
       Version dw ?
       Machine dw ?
       TimeDateStamp dd ?
       SizeOfData dd ?
       union
	   Ordinal dw ?
	   Hint dw ?
       ends
       union
	   Type dw ?
	   NameType dw ?
	   Reserved dw ?
       ends
ends

IMPORT_OBJECT_CODE = 0
IMPORT_OBJECT_DATA = 1
IMPORT_OBJECT_CONST = 2
IMPORT_OBJECT_ORDINAL = 0
IMPORT_OBJECT_NAME = 1
IMPORT_OBJECT_NAME_NO_PREFIX = 2
IMPORT_OBJECT_NAME_UNDECORATE = 3

COMIMAGE_FLAGS_ILONLY = 1
COMIMAGE_FLAGS_32BITREQUIRED = 2
COMIMAGE_FLAGS_IL_LIBRARY = 4
COMIMAGE_FLAGS_STRONGNAMESIGNED = 8
COMIMAGE_FLAGS_TRACKDEBUGDATA = $10000
COR_VERSION_MAJOR_V2  = 2
COR_VERSION_MAJOR = COR_VERSION_MAJOR_V2
COR_VERSION_MINOR = 0
COR_DELETED_NAME_LENGTH = 8
COR_VTABLEGAP_NAME_LENGTH = 8
NATIVE_TYPE_MAX_CB = 1
COR_ILMETHOD_SECT_SMALL_MAX_DATASIZE = $FF
IMAGE_COR_MIH_METHODRVA = 1
IMAGE_COR_MIH_EHRVA = 2
IMAGE_COR_MIH_BASICBLOCK = 8
COR_VTABLE_32BIT = 1
COR_VTABLE_64BIT = 2
COR_VTABLE_FROM_UNMANAGED = 4
COR_VTABLE_CALL_MOST_DERIVED = $10
IMAGE_COR_EATJ_THUNK_SIZE = 32
MAX_CLASS_NAME = 1024
MAX_PACKAGE_NAME = 1024

struct IMAGECOR20HEADER
       cb dd ?
       MajorRuntimeVersion dw ?
       MinorRuntimeVersion dw ?
       MetaData IMAGEDATADIRECTORY
       Flags dd ?
       EntryPointToken dd ?
       Resources IMAGEDATADIRECTORY
       StrongNameSignature IMAGEDATADIRECTORY
       CodeManagerTable IMAGEDATADIRECTORY
       VTableFixups IMAGEDATADIRECTORY
       ExportAddressTableJumps IMAGEDATADIRECTORY
       ManagedNativeHeader IMAGEDATADIRECTORY
ends

struct SLISTHEADER
       union
	   struct
	       Alignment dq ?
	       Region dq ?
	   ends
	   union
	       Depth8 dq ?
	       Sequence8 dq ?
	       NextEntry8 dq ?
	       HeaderType8 dq ?
	       Init8 dq ?
	       Reserved8 dq ?
	       Region8 dq ?
	   ends
	   union
	       Depth16 dq ?
	       Sequence16 dq ?
	       HeaderType16 dq ?
	       Init16 dq ?
	       Reserved16 dq ?
	       NextEntry16 dq ?
	   ends
	   union
	       Depth64 dq ?
	       Sequence64 dq ?
	       HeaderType64 dq ?
	       Reserved64 dq ?
	       NextEntry64 dq ?
	   ends
       ends
ends

HEAP_NO_SERIALIZE = 1
HEAP_GROWABLE = 2
HEAP_GENERATE_EXCEPTIONS = 4
HEAP_ZERO_MEMORY = 8
HEAP_REALLOC_IN_PLACE_ONLY = $10
HEAP_TAIL_CHECKING_ENABLED = $20
HEAP_FREE_CHECKING_ENABLED = $40
HEAP_DISABLE_COALESCE_ON_FREE = $80
HEAP_CREATE_ALIGN_16 = $10000
HEAP_CREATE_ENABLE_TRACING = $20000
HEAP_MAXIMUM_TAG = $FFF
HEAP_PSEUDO_TAG_FLAG = $8000
HEAP_TAG_SHIFT = 18

IS_TEXT_UNICODE_ASCII16 = 1
IS_TEXT_UNICODE_REVERSE_ASCII16 = $10
IS_TEXT_UNICODE_STATISTICS = 2
IS_TEXT_UNICODE_REVERSE_STATISTICS = $20
IS_TEXT_UNICODE_CONTROLS = 4
IS_TEXT_UNICODE_REVERSE_CONTROLS = $40
IS_TEXT_UNICODE_SIGNATURE = 8
IS_TEXT_UNICODE_REVERSE_SIGNATURE = $80
IS_TEXT_UNICODE_ILLEGAL_CHARS = $100
IS_TEXT_UNICODE_ODD_LENGTH = $200
IS_TEXT_UNICODE_DBCS_LEADBYTE = $400
IS_TEXT_UNICODE_NULL_BYTES = $1000
IS_TEXT_UNICODE_UNICODE_MASK = $F
IS_TEXT_UNICODE_REVERSE_MASK = $F0
IS_TEXT_UNICODE_NOT_UNICODE_MASK = $F00
IS_TEXT_UNICODE_NOT_ASCII_MASK = $F000

COMPRESSION_FORMAT_NONE = 0
COMPRESSION_FORMAT_DEFAULT = 1
COMPRESSION_FORMAT_LZNT1 = 2
COMPRESSION_ENGINE_STANDARD = 0
COMPRESSION_ENGINE_MAXIMUM = $100
COMPRESSION_ENGINE_HIBER = $200

struct MESSAGERESOURCEENTRY
       Length dw ?
       Flags dw ?
       Text db ?,?
ends

MESSAGE_RESOURCE_UNICODE = 1

struct MESSAGERESOURCEBLOCK
       LowId dd ?
       HighId dd ?
       OffsetToEntries dd ?
ends

struct MESSAGERESOURCEDATA
       NumberOfBlocks dd ?
       Blocks MESSAGERESOURCEBLOCK
ends

struct OSVERSIONINFO
       dwOSVersionInfoSize dd ?
       dwMajorVersion dd ?
       dwMinorVersion dd ?
       dwBuildNumber dd ?
       dwPlatformId dd ?
       szCSDVersion TCHAR 128 dup(?)
ends


struct OSVERSIONINFOEX
       dwOSVersionInfoSize dd ?
       dwMajorVersion dd ?
       dwMinorVersion dd ?
       dwBuildNumber dd ?
       dwPlatformId dd ?
       szCSDVersion TCHAR 128 dup(?)
       wServicePackMajor dw ?
       wServicePackMinor dw ?
       wSuiteMask dw ?
       wProductType db ?
       wReserved db ?
ends

VER_EQUAL = 1
VER_GREATER = 2
VER_GREATER_EQUAL = 3
VER_LESS = 4
VER_LESS_EQUAL = 5
VER_AND = 6
VER_OR = 7
VER_CONDITION_MASK = 7
VER_NUM_BITS_PER_CONDITION_MASK = 3

VER_MINORVERSION = 1
VER_MAJORVERSION = 2
VER_BUILDNUMBER = 4
VER_PLATFORMID = 8
VER_SERVICEPACKMINOR = $10
VER_SERVICEPACKMAJOR = $20
VER_SUITENAME = $40
VER_PRODUCT_TYPE = $80

VER_NT_WORKSTATION = 1
VER_NT_DOMAIN_CONTROLLER = 2
VER_NT_SERVER = 3

VER_PLATFORM_WIN32s = 0
VER_PLATFORM_WIN32_WINDOWS = 1
VER_PLATFORM_WIN32_NT = 2

struct RTLCRITICALSECTIONDEBUG
       Type dw ?
       CreatorBackTraceIndex dw ?
       pad1 dd ?
       CriticalSection dq ?
       ProcessLocksList LISTENTRY64
       EntryCount dd ?
       ContentionCount dd ?;
       Flags dd ?
       CreatorBackTraceIndexHigh dw ?
       SpareWORD dw ?
ends

RTL_CRITSECT_TYPE = 0
RTL_RESOURCE_TYPE = 1

struct RTLCRITICALSECTION
       DebugInfo dq ?
       LockCount dd ?
       RecursionCount dd ?
       OwningThread dq ?
       LockSemaphore dq ?
       SpinCount dq ?
ends

struct RTLVERIFIERTHUNKDESCRIPTOR
       ThunkName dd ?
       ThunkOldAddress dd ?
       ThunkNewAddress dd ?
ends

struct RTLVERIFIERDLLDESCRIPTOR
       DllName dd ?
       DllFlags dd ?
       DllAddress dd ?
       DllThunks dd ?
ends

struct RTLVERIFIERPROVIDERDESCRIPTOR
       Length dd ?
       ProviderDlls  dd ?
       ProviderDllLoadCallback dd ?
       ProviderDllUnloadCallback dd ?
       VerifierImage dd ?
       VerifierFlags dd ?
       VerifierDebug dd ?
       RtlpGetStackTraceAddress dd ?
       RtlpDebugPageHeapCreate dd ?
       RtlpDebugPageHeapDestroy dd ?
       ProviderNtdllHeapFreeCallback dd ?
ends

RTL_VRF_FLG_FULL_PAGE_HEAP = 1
RTL_VRF_FLG_RESERVED_DONOTUSE = 2
RTL_VRF_FLG_HANDLE_CHECKS = 4
RTL_VRF_FLG_STACK_CHECKS = 8
RTL_VRF_FLG_APPCOMPAT_CHECKS = $10
RTL_VRF_FLG_TLS_CHECKS = $20
RTL_VRF_FLG_DIRTY_STACKS = $40
RTL_VRF_FLG_RPC_CHECKS = $80
RTL_VRF_FLG_COM_CHECKS = $100
RTL_VRF_FLG_DANGEROUS_APIS = $200
RTL_VRF_FLG_RACE_CHECKS = $400
RTL_VRF_FLG_DEADLOCK_CHECKS = $800
RTL_VRF_FLG_FIRST_CHANCE_EXCEPTION_CHECKS = $1000
RTL_VRF_FLG_VIRTUAL_MEM_CHECKS = $2000
RTL_VRF_FLG_ENABLE_LOGGING = $4000
RTL_VRF_FLG_FAST_FILL_HEAP = $8000
RTL_VRF_FLG_VIRTUAL_SPACE_TRACKING = $10000
RTL_VRF_FLG_ENABLED_SYSTEM_WIDE = $20000
RTL_VRF_FLG_MISCELLANEOUS_CHECKS = $20000
RTL_VRF_FLG_LOCK_CHECKSv = $40000

APPLICATION_VERIFIER_INTERNAL_ERROR = $80000000
APPLICATION_VERIFIER_INTERNAL_WARNING = $40000000
APPLICATION_VERIFIER_NO_BREAK = $20000000
APPLICATION_VERIFIER_CONTINUABLE_BREAK = $10000000
APPLICATION_VERIFIER_UNKNOWN_ERROR = 1
APPLICATION_VERIFIER_ACCESS_VIOLATION = 2
APPLICATION_VERIFIER_UNSYNCHRONIZED_ACCESS = 3
APPLICATION_VERIFIER_EXTREME_SIZE_REQUEST = 4
APPLICATION_VERIFIER_BAD_HEAP_HANDLE = 5
APPLICATION_VERIFIER_SWITCHED_HEAP_HANDLE = 6
APPLICATION_VERIFIER_DOUBLE_FREE = 7
APPLICATION_VERIFIER_CORRUPTED_HEAP_BLOCK = 8
APPLICATION_VERIFIER_DESTROY_PROCESS_HEAP = 9
APPLICATION_VERIFIER_UNEXPECTED_EXCEPTION = $A
APPLICATION_VERIFIER_STACK_OVERFLOW = $B
APPLICATION_VERIFIER_TERMINATE_THREAD_CALL = $100
APPLICATION_VERIFIER_INVALID_EXIT_PROCESS_CALL = $101
APPLICATION_VERIFIER_EXIT_THREAD_OWNS_LOCK = $200
APPLICATION_VERIFIER_LOCK_IN_UNLOADED_DLL = $201
APPLICATION_VERIFIER_LOCK_IN_FREED_HEAP = $202
APPLICATION_VERIFIER_LOCK_DOUBLE_INITIALIZE = $203
APPLICATION_VERIFIER_LOCK_IN_FREED_MEMORY = $204
APPLICATION_VERIFIER_LOCK_CORRUPTED = $205
APPLICATION_VERIFIER_LOCK_INVALID_OWNER = $206
APPLICATION_VERIFIER_LOCK_INVALID_RECURSION_COUNT = $207
APPLICATION_VERIFIER_LOCK_INVALID_LOCK_COUNT = $208
APPLICATION_VERIFIER_LOCK_OVER_RELEASED = $209
APPLICATION_VERIFIER_LOCK_NOT_INITIALIZED = $210
APPLICATION_VERIFIER_LOCK_ALREADY_INITIALIZED = $211
APPLICATION_VERIFIER_INVALID_HANDLE = $300
APPLICATION_VERIFIER_INVALID_TLS_VALUE = $301
APPLICATION_VERIFIER_INCORRECT_WAIT_CALL = $302
APPLICATION_VERIFIER_NULL_HANDLE = $303
APPLICATION_VERIFIER_WAIT_IN_DLLMAIN = $304
APPLICATION_VERIFIER_COM_ERROR = $400
APPLICATION_VERIFIER_COM_API_IN_DLLMAIN = $401
APPLICATION_VERIFIER_COM_UNHANDLED_EXCEPTION = $402
APPLICATION_VERIFIER_COM_UNBALANCED_COINIT = $403
APPLICATION_VERIFIER_COM_UNBALANCED_OLEINIT = $404
APPLICATION_VERIFIER_COM_UNBALANCED_SWC = $405
APPLICATION_VERIFIER_COM_NULL_DACL = $406
APPLICATION_VERIFIER_COM_UNSAFE_IMPERSONATION = $407
APPLICATION_VERIFIER_COM_SMUGGLED_WRAPPER = $408
APPLICATION_VERIFIER_COM_SMUGGLED_PROXY = $409
APPLICATION_VERIFIER_COM_CF_SUCCESS_WITH_NULL = $40A
APPLICATION_VERIFIER_COM_GCO_SUCCESS_WITH_NULL = $40B
APPLICATION_VERIFIER_COM_OBJECT_IN_FREED_MEMORY = $40C
APPLICATION_VERIFIER_COM_OBJECT_IN_UNLOADED_DLL = $40D
APPLICATION_VERIFIER_COM_VTBL_IN_FREED_MEMORY = $40E
APPLICATION_VERIFIER_COM_VTBL_IN_UNLOADED_DLL = $40F
APPLICATION_VERIFIER_COM_HOLDING_LOCKS_ON_CALL = $410
APPLICATION_VERIFIER_RPC_ERROR = $500
APPLICATION_VERIFIER_INVALID_FREEMEM = $600
APPLICATION_VERIFIER_INVALID_ALLOCMEM = $601
APPLICATION_VERIFIER_INVALID_MAPVIEW = $602
APPLICATION_VERIFIER_PROBE_INVALID_ADDRESS = $603
APPLICATION_VERIFIER_PROBE_FREE_MEM = $604
APPLICATION_VERIFIER_PROBE_GUARD_PAGE = $605
APPLICATION_VERIFIER_PROBE_NULL = $606
APPLICATION_VERIFIER_PROBE_INVALID_START_OR_SIZE = $607

SEF_DACL_AUTO_INHERIT = 1
SEF_SACL_AUTO_INHERIT = 2
SEF_DEFAULT_DESCRIPTOR_FOR_OBJECT = 4
SEF_AVOID_PRIVILEGE_CHECK = 8
SEF_AVOID_OWNER_CHECK = $10
SEF_DEFAULT_OWNER_FROM_PARENT = $20
SEF_DEFAULT_GROUP_FROM_PARENT = $40

HeapCompatibilityInformation = 1

WT_EXECUTEDEFAULT = 0
WT_EXECUTEINIOTHREAD = 1
WT_EXECUTEINUITHREAD = 2
WT_EXECUTEINWAITTHREAD = 4
WT_EXECUTEONLYONCE = 8
WT_EXECUTEINTIMERTHREAD = $20
WT_EXECUTELONGFUNCTION = $10
WT_EXECUTEINPERSISTENTIOTHREAD = $40
WT_EXECUTEINPERSISTENTTHREAD = $80
WT_TRANSFER_IMPERSONATION = $100
WT_EXECUTEINLONGTHREAD = $10
WT_EXECUTEDELETEWAIT = 8

ActivationContextBasicInformation = 1
ActivationContextDetailedInformation = 2
AssemblyDetailedInformationInActivationContext = 3
FileInformationInAssemblyOfAssemblyInActivationContext = 4
MaxActivationContextInfoClass = 5
AssemblyDetailedInformationInActivationContxt = 3
FileInformationInAssemblyOfAssemblyInActivationContxt = 4

struct ACTIVATIONCONTEXTQUERYINDEX
       ulAssemblyIndex dd ?
       ulFileIndexInAssembly dd ?
ends

ACTIVATION_CONTEXT_PATH_TYPE_NONE = 1
ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE = 2
ACTIVATION_CONTEXT_PATH_TYPE_URL = 3
ACTIVATION_CONTEXT_PATH_TYPE_ASSEMBLYREF = 4

struct ASSEMBLYFILEDETAILEDINFORMATION
       ulFlags dd ?
       ulFilenameLength dd ?
       ulPathLength dd ?
       pad1 dd ?
       lpFileName dq ?
       lpFilePath dq ?
ends

;ASSEMBLY_DLL_REDIRECTION_DETAILED_INFORMATION = ASSEMBLY_FILE_DETAILED_INFORMATION
;ASSEMBLY_DLL_REDIRECTION_DETAILED_INFORMATION = ASSEMBLY_FILE_DETAILED_INFORMATION
;PASSEMBLY_DLL_REDIRECTION_DETAILED_INFORMATION = PASSEMBLY_FILE_DETAILED_INFORMATION
;PCASSEMBLY_DLL_REDIRECTION_DETAILED_INFORMATION = PCASSEMBLY_FILE_DETAILED_INFORMATION

struct ACTIVATIONCONTEXTASSEMBLYDETAILEDINFORMATION
       ulFlags dd ?
       ulEncodedAssemblyIdentityLength dd ?
       ulManifestPathType dd ?
       ulManifestPathLength dd ?
       liManifestLastWriteTime dq ?
       ulPolicyPathType dd ?
       ulPolicyPathLength dd ?
       liPolicyLastWriteTime dq ?
       ulMetadataSatelliteRosterIndex dd ?
       ulManifestVersionMajor dd ?
       ulManifestVersionMinor dd ?
       ulPolicyVersionMajor dd ?
       ulPolicyVersionMinor dd ?
       ulAssemblyDirectoryNameLength dd ?
       lpAssemblyEncodedAssemblyIdentity dq ?
       lpAssemblyManifestPath dq ?
       lpAssemblyPolicyPath dq ?
       lpAssemblyDirectoryName dq ?
       ulFileCount dd ?
       pad1 dd ?
 ends

struct ACTIVATIONCONTEXTDETAILEDINFORMATION
       dwFlags dd ?
       ulFormatVersion dd ?
       ulAssemblyCount dd ?
       ulRootManifestPathType dd ?
       ulRootManifestPathChars dd ?
       ulRootConfigurationPathType dd ?
       ulRootConfigurationPathChars dd ?
       ulAppDirPathType dd ?
       ulAppDirPathChars dd ?
       pad1 dd ?
       lpRootManifestPath dq ?
       lpRootConfigurationPath dq ?
       lpAppDirPath dq ?
ends

DLL_PROCESS_ATTACH = 1
DLL_THREAD_ATTACH = 2
DLL_THREAD_DETACH = 3
DLL_PROCESS_DETACH = 0
DLL_PROCESS_VERIFIER = 4

EVENTLOG_SEQUENTIAL_READ = 1
EVENTLOG_SEEK_READ = 2
EVENTLOG_FORWARDS_READ = 4
EVENTLOG_BACKWARDS_READ = 8

EVENTLOG_SUCCESS = 0
EVENTLOG_ERROR_TYPE = 1
EVENTLOG_WARNING_TYPE = 2
EVENTLOG_INFORMATION_TYPE = 4
EVENTLOG_AUDIT_SUCCESS = 8
EVENTLOG_AUDIT_FAILURE = $10

EVENTLOG_START_PAIRED_EVENT = 1
EVENTLOG_END_PAIRED_EVENT = 2
EVENTLOG_END_ALL_PAIRED_EVENTS = 4
EVENTLOG_PAIRED_EVENT_ACTIVE = 8
EVENTLOG_PAIRED_EVENT_INACTIVE = $10

struct EVENTLOGRECORD
       Length dd ?
       Reserved dd ?
       RecordNumber dd ?
       TimeGenerated dd ?
       TimeWritten dd ?
       EventID dd ?
       EventType dw ?
       NumStrings dw ?
       EventCategory dw ?
       ReservedFlags dw ?
       ClosingRecordNumber dd ?
       StringOffset dd ?
       UserSidLength dd ?
       UserSidOffset dd ?
       DataLength dd ?
       DataOffset dd ?
ends

MAXLOGICALLOGNAMESIZE = 256

struct EVENTSFORLOGFILE
       ulSize dd ?
       szLogicalLogFile du MAXLOGICALLOGNAMESIZE dup(?)
       ulNumRecords dd ?,?
       pEventLogRecords dq ?
ends

struct PACKEDEVENTINFO
       ulSize dd ?
       ulNumEventsForLogFile dd ?
       ulOffsets dd ?
ends

KEY_QUERY_VALUE = 1
KEY_SET_VALUE = 2
KEY_CREATE_SUB_KEY = 4
KEY_ENUMERATE_SUB_KEYS = 8
KEY_NOTIFY = $10
KEY_CREATE_LINK = $20
KEY_WOW64_32KEY = $200
KEY_WOW64_64KEY = $100
KEY_WOW64_RES = $300

KEY_READ = STANDARD_RIGHTS_READ or KEY_QUERY_VALUE or KEY_ENUMERATE_SUB_KEYS or \
	   KEY_NOTIFY and (not SYNCHRONIZE)


KEY_WRITE = STANDARD_RIGHTS_WRITE or KEY_SET_VALUE or KEY_CREATE_SUB_KEY and (not SYNCHRONIZE)

KEY_EXECUTE = KEY_READ and (not SYNCHRONIZE)

KEY_ALL_ACCESS = STANDARD_RIGHTS_ALL or KEY_QUERY_VALUE or KEY_SET_VALUE or \
		 KEY_CREATE_SUB_KEY or KEY_ENUMERATE_SUB_KEYS or KEY_NOTIFY or KEY_CREATE_LINK \
		 and (not SYNCHRONIZE)

REG_OPTION_RESERVED = 0
REG_OPTION_NON_VOLATILE = 0
REG_OPTION_VOLATILE = 1
REG_OPTION_CREATE_LINK = 2
REG_OPTION_BACKUP_RESTORE = 4
REG_OPTION_OPEN_LINK = 8

REG_LEGAL_OPTION = REG_OPTION_RESERVED or REG_OPTION_NON_VOLATILE or REG_OPTION_VOLATILE or\
		   REG_OPTION_CREATE_LINK or REG_OPTION_BACKUP_RESTORE or REG_OPTION_OPEN_LINK

REG_CREATED_NEW_KEY = 1
REG_OPENED_EXISTING_KEY = 2

REG_STANDARD_FORMAT = 1
REG_LATEST_FORMAT = 2
REG_NO_COMPRESSION = 4

REG_WHOLE_HIVE_VOLATILE = 1
REG_REFRESH_HIVE = 2
REG_NO_LAZY_FLUSH = 4
REG_FORCE_RESTORE = 8

REG_FORCE_UNLOAD = 1

REG_NOTIFY_CHANGE_NAME = 1
REG_NOTIFY_CHANGE_ATTRIBUTES = 2
REG_NOTIFY_CHANGE_LAST_SET = 4
REG_NOTIFY_CHANGE_SECURITY = 8
REG_LEGAL_CHANGE_FILTER = REG_NOTIFY_CHANGE_NAME or REG_NOTIFY_CHANGE_ATTRIBUTES or\
			  REG_NOTIFY_CHANGE_LAST_SET or REG_NOTIFY_CHANGE_SECURITY

REG_NONE = 0
REG_SZ = 1
REG_EXPAND_SZ = 2
REG_BINARY = 3
REG_DWORD = 4
REG_DWORD_LITTLE_ENDIAN = 4
REG_DWORD_BIG_ENDIAN = 5
REG_LINK = 6
REG_MULTI_SZ = 7
REG_RESOURCE_LIST = 8
REG_FULL_RESOURCE_DESCRIPTOR = 9
REG_RESOURCE_REQUIREMENTS_LIST = 10
REG_QWORD = 11
REG_QWORD_LITTLE_ENDIAN = 11

; scm.inc

SERVICE_KERNEL_DRIVER		     = 0x00000001
SERVICE_FILE_SYSTEM_DRIVER	     = 0x00000002
SERVICE_ADAPTER 		     = 0x00000004
SERVICE_RECOGNIZER_DRIVER	     = 0x00000008
SERVICE_DRIVER			     = SERVICE_KERNEL_DRIVER + SERVICE_FILE_SYSTEM_DRIVER + SERVICE_RECOGNIZER_DRIVER
SERVICE_WIN32_OWN_PROCESS	     = 0x00000010
SERVICE_WIN32_SHARE_PROCESS	     = 0x00000020
SERVICE_WIN32			     = SERVICE_WIN32_OWN_PROCESS + SERVICE_WIN32_SHARE_PROCESS
SERVICE_INTERACTIVE_PROCESS	     = 0x00000100
SERVICE_TYPE_ALL		     = SERVICE_WIN32+SERVICE_ADAPTER + SERVICE_DRIVER  + SERVICE_INTERACTIVE_PROCESS
SERVICE_BOOT_START		     = 0x00000000
SERVICE_SYSTEM_START		     = 0x00000001
SERVICE_AUTO_START		     = 0x00000002
SERVICE_DEMAND_START		     = 0x00000003
SERVICE_DISABLED		     = 0x00000004
SERVICE_ERROR_IGNORE		     = 0x00000000
SERVICE_ERROR_NORMAL		     = 0x00000001
SERVICE_ERROR_SEVERE		     = 0x00000002
SERVICE_ERROR_CRITICAL		     = 0x00000003

SERVICE_NO_CHANGE		     = 0xFFFFFFFF
SERVICE_ACTIVE			     = 0x00000001
SERVICE_INACTIVE		     = 0x00000002
SERVICE_STATE_ALL		     = SERVICE_ACTIVE + SERVICE_INACTIVE
SERVICE_CONTROL_STOP		     = 0x00000001
SERVICE_CONTROL_PAUSE		     = 0x00000002
SERVICE_CONTROL_CONTINUE	     = 0x00000003
SERVICE_CONTROL_INTERROGATE	     = 0x00000004
SERVICE_CONTROL_SHUTDOWN	     = 0x00000005
SERVICE_STOPPED 		     = 0x00000001
SERVICE_START_PENDING		     = 0x00000002
SERVICE_STOP_PENDING		     = 0x00000003
SERVICE_RUNNING 		     = 0x00000004
SERVICE_CONTINUE_PENDING	     = 0x00000005
SERVICE_PAUSE_PENDING		     = 0x00000006
SERVICE_PAUSED			     = 0x00000007
SERVICE_ACCEPT_STOP		     = 0x00000001
SERVICE_ACCEPT_PAUSE_CONTINUE	     = 0x00000002
SERVICE_ACCEPT_SHUTDOWN 	     = 0x00000004

SC_MANAGER_CONNECT		     = 0x00000001
SC_MANAGER_CREATE_SERVICE	     = 0x00000002
SC_MANAGER_ENUMERATE_SERVICE	     = 0x00000004
SC_MANAGER_LOCK 		     = 0x00000008
SC_MANAGER_QUERY_LOCK_STATUS	     = 0x00000010
SC_MANAGER_MODIFY_BOOT_CONFIG	     = 0x00000020
SC_MANAGER_ALL_ACCESS		     = STANDARD_RIGHTS_REQUIRED + SC_MANAGER_CONNECT + SC_MANAGER_CREATE_SERVICE + \
				       SC_MANAGER_ENUMERATE_SERVICE + SC_MANAGER_LOCK + SC_MANAGER_QUERY_LOCK_STATUS + \
				       SC_MANAGER_MODIFY_BOOT_CONFIG

SERVICE_QUERY_CONFIG		     = 0x00000001
SERVICE_CHANGE_CONFIG		     = 0x00000002
SERVICE_QUERY_STATUS		     = 0x00000004
SERVICE_ENUMERATE_DEPENDENTS	     = 0x00000008
SERVICE_START			     = 0x00000010
SERVICE_STOP			     = 0x00000020
SERVICE_PAUSE_CONTINUE		     = 0x00000040
SERVICE_INTERROGATE		     = 0x00000080
SERVICE_USER_DEFINED_CONTROL	     = 0x00000100
SERVICE_ALL_ACCESS		     = STANDARD_RIGHTS_REQUIRED + SERVICE_QUERY_CONFIG + SERVICE_CHANGE_CONFIG + \
				       SERVICE_QUERY_STATUS + SERVICE_ENUMERATE_DEPENDENTS + SERVICE_START + SERVICE_STOP + \
				       SERVICE_PAUSE_CONTINUE + SERVICE_INTERROGATE + SERVICE_USER_DEFINED_CONTROL

DriverType = SERVICE_KERNEL_DRIVER
FileSystemType = SERVICE_FILE_SYSTEM_DRIVER
Win32ServiceOwnProcess = SERVICE_WIN32_OWN_PROCESS
Win32ServiceShareProcess = SERVICE_WIN32_SHARE_PROCESS
AdapterType = SERVICE_ADAPTER
RecognizerType = SERVICE_RECOGNIZER_DRIVER
BootLoad = SERVICE_BOOT_START
SystemLoad = SERVICE_SYSTEM_START
AutoLoad = SERVICE_AUTO_START
DemandLoad = SERVICE_DEMAND_START
DisableLoad = SERVICE_DISABLED
IgnoreError = SERVICE_ERROR_IGNORE
NormalError = SERVICE_ERROR_NORMAL
SevereError = SERVICE_ERROR_SEVERE
CriticalError = SERVICE_ERROR_CRITICAL

TAPE_ERASE_SHORT = 0
TAPE_ERASE_LONG = 1

struct TAPEERASE
       Type dd ?
       Immediate db ?
ends

TAPE_LOAD = 0
TAPE_UNLOAD = 1
TAPE_TENSION = 2
TAPE_LOCK = 3
TAPE_UNLOCK = 4
TAPE_FORMAT = 5

struct TAPEPREPARE
       Operation dd ?
       Immediate db ?
ends

TAPE_SETMARKS = 0
TAPE_FILEMARKS = 1
TAPE_SHORT_FILEMARKS = 2
TAPE_LONG_FILEMARKS = 3

struct TAPEWRITEMARKS
       Type dd ?
       Count dd ?
       Immediate db ?
ends

TAPE_ABSOLUTE_POSITION = 0
TAPE_LOGICAL_POSITION = 1
TAPE_PSEUDO_LOGICAL_POSITION = 2

struct TAPEGETPOSITION
       Type dd ?
       Partition dd ?
       Offset dq ?
ends

TAPE_REWIND = 0
TAPE_ABSOLUTE_BLOCK = 1
TAPE_LOGICAL_BLOCK = 2
TAPE_PSEUDO_LOGICAL_BLOCK = 3
TAPE_SPACE_END_OF_DATA = 4
TAPE_SPACE_RELATIVE_BLOCKS = 5
TAPE_SPACE_FILEMARKS = 6
TAPE_SPACE_SEQUENTIAL_FMKS = 7
TAPE_SPACE_SETMARKS = 8
TAPE_SPACE_SEQUENTIAL_SMKS = 9

struct TAPESETPOSITION
       Method dd ?
       Partition dd ?
       Offset dq ?
       Immediate db ?
ends

TAPE_DRIVE_FIXED = 1
TAPE_DRIVE_SELECT = 2
TAPE_DRIVE_INITIATOR = 4
TAPE_DRIVE_ERASE_SHORT = $10
TAPE_DRIVE_ERASE_LONG = $20
TAPE_DRIVE_ERASE_BOP_ONLY = $40
TAPE_DRIVE_ERASE_IMMEDIATE = $80
TAPE_DRIVE_TAPE_CAPACITY = $100
TAPE_DRIVE_TAPE_REMAINING = $200
TAPE_DRIVE_FIXED_BLOCK = $400
TAPE_DRIVE_VARIABLE_BLOCK = $800
TAPE_DRIVE_WRITE_PROTECT = $1000
TAPE_DRIVE_EOT_WZ_SIZE = $2000
TAPE_DRIVE_ECC = $10000
TAPE_DRIVE_COMPRESSION = $20000
TAPE_DRIVE_PADDING = $40000
TAPE_DRIVE_REPORT_SMKS = $80000
TAPE_DRIVE_GET_ABSOLUTE_BLK = $100000
TAPE_DRIVE_GET_LOGICAL_BLK = $200000
TAPE_DRIVE_SET_EOT_WZ_SIZE = $400000
TAPE_DRIVE_EJECT_MEDIA = $1000000
TAPE_DRIVE_CLEAN_REQUESTS = $2000000
TAPE_DRIVE_SET_CMP_BOP_ONLY = $4000000
TAPE_DRIVE_RESERVED_BIT = $80000000

TAPE_DRIVE_LOAD_UNLOAD = $80000001
TAPE_DRIVE_TENSION = $80000002
TAPE_DRIVE_LOCK_UNLOCK = $80000004
TAPE_DRIVE_REWIND_IMMEDIATE = $80000008
TAPE_DRIVE_SET_BLOCK_SIZE = $80000010
TAPE_DRIVE_LOAD_UNLD_IMMED = $80000020
TAPE_DRIVE_TENSION_IMMED = $80000040
TAPE_DRIVE_LOCK_UNLK_IMMED = $80000080
TAPE_DRIVE_SET_ECC = $80000100
TAPE_DRIVE_SET_COMPRESSION = $80000200
TAPE_DRIVE_SET_PADDING = $80000400
TAPE_DRIVE_SET_REPORT_SMKS = $80000800
TAPE_DRIVE_ABSOLUTE_BLK = $80001000
TAPE_DRIVE_ABS_BLK_IMMED = $80002000
TAPE_DRIVE_LOGICAL_BLK = $80004000
TAPE_DRIVE_LOG_BLK_IMMED = $80008000
TAPE_DRIVE_END_OF_DATA = $80010000
TAPE_DRIVE_RELATIVE_BLKS = $80020000
TAPE_DRIVE_FILEMARKS = $80040000
TAPE_DRIVE_SEQUENTIAL_FMKS = $80080000
TAPE_DRIVE_SETMARKS = $80100000
TAPE_DRIVE_SEQUENTIAL_SMKS = $80200000
TAPE_DRIVE_REVERSE_POSITION = $80400000
TAPE_DRIVE_SPACE_IMMEDIATE = $80800000
TAPE_DRIVE_WRITE_SETMARKS = $81000000
TAPE_DRIVE_WRITE_FILEMARKS = $82000000
TAPE_DRIVE_WRITE_SHORT_FMKS = $84000000
TAPE_DRIVE_WRITE_LONG_FMKS = $88000000
TAPE_DRIVE_WRITE_MARK_IMMED = $90000000
TAPE_DRIVE_FORMAT = $A0000000
TAPE_DRIVE_FORMAT_IMMEDIATE = $C0000000
TAPE_DRIVE_HIGH_FEATURES = $80000000

struct TAPEGETDRIVEPARAMETERS
       ECC db ?
       Compression db ?
       DataPadding db ?
       ReportSetmarks db ?
       DefaultBlockSize dd ?
       MaximumBlockSize dd ?
       MinimumBlockSize dd ?
       MaximumPartitionCount dd ?
       FeaturesLow dd ?
       FeaturesHigh dd ?
       EOTWarningZoneSize dd ?
ends

struct TAPESETDRIVEPARAMETERS
       ECC db ?
       Compression db ?
       DataPadding db ?
       ReportSetmarks db ?
       EOTWarningZoneSize dd ?
ends

struct TAPEGETMEDIAPARAMETERS
       Capacity dq ?
       Remaining dq ?
       BlockSize dd ?
       PartitionCount dd ?
       WriteProtected db ?
ends

struct TAPESETMEDIAPARAMETERS
       BlockSize dd ?
ends

TAPE_FIXED_PARTITIONS = 0
TAPE_SELECT_PARTITIONS = 1
TAPE_INITIATOR_PARTITIONS = 2

struct TAPECREATEPARTITION
       Method dd ?
       Count dd ?
       Size dd ?
ends

TAPE_QUERY_DRIVE_PARAMETERS = 0
TAPE_QUERY_MEDIA_CAPACITY = 1
TAPE_CHECK_FOR_DRIVE_PROBLEM = 2
TAPE_QUERY_IO_ERROR_DATA = 3
TAPE_QUERY_DEVICE_ERROR_DATA = 4

struct TAPEWMIOPERATIONS
       Method dd ?
       DataBufferSize dd ?
       DataBuffer dq ?
ends

TapeDriveProblemNone = 0
TapeDriveReadWriteWarning = 1
TapeDriveReadWriteError = 2
TapeDriveReadWarning = 3
TapeDriveWriteWarning = 4
TapeDriveReadError = 5
TapeDriveWriteError = 6
TapeDriveHardwareError = 7
TapeDriveUnsupportedMedia = 8
TapeDriveScsiConnectionError = 9
TapeDriveTimetoClean = 10
TapeDriveCleanDriveNow = 11
TapeDriveMediaLifeExpired = 12
TapeDriveSnappedTape = 13

ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION = 1
ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION = 2
ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION = 3
ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION = 4
ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION = 5
ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION = 6
ACTIVATION_CONTEXT_SECTION_COM_PROGID_REDIRECTION = 7
ACTIVATION_CONTEXT_SECTION_GLOBAL_OBJECT_RENAME_TABLE = 8
ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES = 9

;max(a,b)            (((a) > (b)) ? (a) : (b))
;min(a,b)            (((a) < (b)) ? (a) : (b))
;LOWORD(           ((WORD)((DWORD_PTR)( & 0xffff))
;HIWORD(           ((WORD)((DWORD_PTR)(y >> 16))
;LOBYTE(w)           ((BYTE)((DWORD_PTR)(w) & 0xff))
;HIBYTE(w)           ((BYTE)((DWORD_PTR)(w) >> 8))

DM_UPDATE = 1
DM_COPY = 2
DM_PROMPT = 4
DM_MODIFY = 8

DM_IN_BUFFER = DM_MODIFY
DM_IN_PROMPT = DM_PROMPT
DM_OUT_BUFFER = DM_COPY
DM_OUT_DEFAULT = DM_UPDATE

DC_FIELDS = 1
DC_PAPERS = 2
DC_PAPERSIZE = 3
DC_MINEXTENT = 4
DC_MAXEXTENT = 5
DC_BINS = 6
DC_DUPLEX = 7
DC_SIZE = 8
DC_EXTRA = 9
DC_VERSION = 10
DC_DRIVER = 11
DC_BINNAMES = 12
DC_ENUMRESOLUTIONS = 13
DC_FILEDEPENDENCIES = 14
DC_TRUETYPE = 15
DC_PAPERNAMES = 16
DC_ORIENTATION = 17
DC_COPIES = 18

;wtypes.h
struct HMETAFILEPICT
       mm dd ?
       xExt dd ?
       yExt dd ?
       cbData dd ?
       data db ?,?,?,?
ends

struct HENHMETAFILE
       cbData dd ?
       data db ?,?,?,?
ends

struct HBITMAP
       cbData dd ?
       data db ?,?,?,?
ends

struct HPALETTE
       cbData dd ?
       data db ?,?,?,?
ends

struct BRUSH
       cbData dd ?
       data db ?,?,?
ends

struct PALETTEENTRY
       peRed db ?
       peGreen db ?
       peBlue db ?
       peFlags db ?
ends

struct LOGPALETTE
       palVersion dw ?
       palNumEntries dw ?
       palPalEntry PALETTEENTRY
ends

struct FILETIME
       dwLowDateTime dd ?
       dwHighDateTime dd ?
ends

struct SYSTEMTIME
       wYear dw ?
       wMonth dw ?
       wDayOfWeek dw ?
       wDay dw ?
       wHour dw ?
       wMinute dw ?
       wSecond dw ?
       wMilliseconds dw ?
ends

struct SECURITYATTRIBUTES
       nLength dd ?
       pad1 dd ?
       lpSecurityDescriptor dq ?
       bInheritHandle dd ?
       pad2 dd ?
ends

struct SECURITYDESCRIPTOR
       Revision db ?
       Sbz1 db ?
       Control dw ?,?,?
       Owner dq ?
       Group dq ?
       Sacl dq ?
       Dacl dq ?
ends

struct COAUTHIDENTITY
       User dq ?
       UserLength dd ?,?
       Domain dq ?
       DomainLength dd ?,?
       Password dq ?
       PasswordLength dd ?
       Flags dd ?
ends

struct COAUTHINFO
       dwAuthnSvc dd ?
       dwAuthzSvc dd ?
       pwszServerPrincName dq ?
       dwAuthnLevel dd ?
       dwImpersonationLevel dd ?
       pAuthIdentityData dq ?
       dwCapabilities dd ?,?
ends

MEMCTX_TASK = 1
MEMCTX_SHARED = 2
MEMCTX_MACSYSTEM = 3
MEMCTX_UNKNOWN = -1
MEMCTX_SAME = -2

ROTFLAGS_REGISTRATIONKEEPSALIVE = 1
ROTFLAGS_ALLOWANYCLIENT = 2
ROT_COMPARE_MAX = 2048

CLSCTX_INPROC_SERVER = 1
CLSCTX_INPROC_HANDLER = 2
CLSCTX_LOCAL_SERVER = 4
CLSCTX_INPROC_SERVER16 = 8
CLSCTX_REMOTE_SERVER = $10
CLSCTX_INPROC_HANDLER16 = $20
CLSCTX_RESERVED1 = $40
CLSCTX_RESERVED2 = $80
CLSCTX_RESERVED3 = $100
CLSCTX_RESERVED4 = $200
CLSCTX_NO_CODE_DOWNLOAD = $400
CLSCTX_RESERVED5 = $800
CLSCTX_NO_CUSTOM_MARSHAL = $1000
CLSCTX_ENABLE_CODE_DOWNLOAD = $2000
CLSCTX_NO_FAILURE_LOG = $4000
CLSCTX_DISABLE_AAA = $8000
CLSCTX_ENABLE_AAA = $10000
CLSCTX_FROM_DEFAULT_CONTEXT = $20000

MSHLFLAGS_NORMAL = 0
MSHLFLAGS_TABLESTRONG = 1
MSHLFLAGS_TABLEWEAK = 2
MSHLFLAGS_NOPING = 4
MSHLFLAGS_RESERVED1 = 8
MSHLFLAGS_RESERVED2 = 16
MSHLFLAGS_RESERVED3 = 32
MSHLFLAGS_RESERVED4 = 64

MSHCTX_LOCAL = 0
MSHCTX_NOSHAREDMEM = 1
MSHCTX_DIFFERENTMACHINE = 2
MSHCTX_INPROC = 3
MSHCTX_CROSSCTX = 4

DVASPECT_CONTENT = 1
DVASPECT_THUMBNAIL = 2
DVASPECT_ICON = 4
DVASPECT_DOCPRINT = 8

STGC_DEFAULT = 0
STGC_OVERWRITE	= 1
STGC_ONLYIFCURRENT = 2
STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE = 4
STGC_CONSOLIDATE = 8

STGMOVE_MOVE = 0
STGMOVE_COPY = 1
STGMOVE_SHALLOWCOPY = 2

STATFLAG_DEFAULT = 0
STATFLAG_NONAME = 1
STATFLAG_NOOPEN = 2

struct BYTEBLOB
       clSize dd ?
       abData db ?,?,?,?
ends

struct WORDBLOB
       clSize dd ?
       asData dw ?,?
ends

struct DWORDBLOB
       clSize dd ?
       alData dd ?
ends

struct FLAGGEDBYTEBLOB
       fFlags dd ?
       clSize dd ?
       abdata db ?,?,?,?
ends

struct FLAGGEDWORDBLOB
       fFlags dd ?
       clSize dd ?
       adData dw ?,?
ends

struct BYTESIZEDARR
       clSize dd ?,?
       pData dq ?
ends

struct WORDSIZEDARR
       clSize dd ?,?
       pData dq ?
ends

struct DWORDSIZEDARR
       clSize dd ?,?
       pData dq ?
ends

struct HYPERSIZEDARR
       clSize dd ?,?
       hyper dq ?
ends

WDT_INPROC_CALL = $48746457
WDT_REMOTE_CALL = $52746457
WDT_INPROC64_CALL = $50746457

struct CLIPFORMAT
       fContext dd ?,?
       union
	   dwValue dd ?
	   pwszName dq ?
       ends
ends

struct GDINONREMOTE
       fContext dd ?,?
       union
	   hInproc dd ?
	   hRemote dq ?
       ends
ends

struct METAFILEPICT
       mm dd ?
       xExt dd ?
       yExt dd ?
       pad1 dd ?
       hMF dq ?
ends

struct HMETAFILEPICT
       fContext dd ?,?
       union
	   hInproc dd ?
	   hRemote dq ?
	   hInproc64 dq ?
       ends
ends

struct HENHMETAFILE
       fContext dd ?,?
       union
	   hInproc dd ?
	   hRemote dq ?
	   hInproc64 dq ?
       ends
ends

struct userBITMAP
       bmType dd ?
       bmWidth dd ?
       bmHeight dd ?
       bmWidthBytes dd ?
       bmPlanes dw ?
       bmBitsPixel dw ?
       cbSize dd ?
       pBuffer db ?,?,?,?
ends

struct userHBITMAP
       fContext dd ?,?
       union
	   hInproc dd ?
	   hRemote dd ?
	   hInproc64 dq ?
       ends
ends

struct userHPALETTE
       fContext dd ?,?
       union
	   hInproc dd ?
	   hRemote dq ?
	   hInproc64 dq ?
       ends
ends

struct RemotableHandle
       fContext dd ?
       union
	   hInproc dd ?
	   hRemote dd ?
       ends
ends

struct MSG
       hwnd dq ?
       message dd ?,?
       wParam dq ?
       lParam dq ?
       time dd ?
       pt POINT
ends

struct CY
       union
	   struct
	       Hi dd ?
	       Lo dd ?
	   ends
	   int64 LARGEINTEGER
       ends
ends

struct DECIMAL
       wReserved dw ?
       union
	   struct
	       scale db ?
	       sign db ?
	   ends
	   signscale dw ?
       ends
       Hi32 dd ?
       union
	   struct
	       Lo32 dd ?
	       Mid32 dd ?
	   ends
	   Lo64 dq ?
       ends
ends

struct BSTRBLOB
       cbSize dd ?
       pData dd ?
ends

;VARIANT_TRUE = VARIANT_BOOL-1
;VARIANT_FALSE = VARIANT_BOOL
struct BLOB
       cbSize dd ?,?
       pBlobData dq ?
ends

struct CLIPDATA
       cbSize dd ?
       ulClipFmt dd ?
       pClipData dq ?
ends

VT_EMPTY = 0
VT_NULL = 1
VT_I2 = 2
VT_I4 = 3
VT_R4 = 4
VT_R8 = 5
VT_CY = 6
VT_DATE = 7
VT_BSTR = 8
VT_DISPATCH = 9
VT_ERROR = 10
VT_BOOL = 11
VT_VARIANT = 12
VT_UNKNOWN = 13
VT_DECIMAL = 14
VT_I1 = 16
VT_UI1 = 17
VT_UI2 = 18
VT_UI4 = 19
VT_I8 = 20
VT_UI8 = 21
VT_INT = 22
VT_UINT = 23
VT_VOID = 24
VT_HRESULT = 25
VT_PTR = 26
VT_SAFEARRAY = 27
VT_CARRAY = 28
VT_USERDEFINED = 29
VT_LPSTR = 30
VT_LPWSTR = 31
VT_RECORD = 36
VT_INT_PTR = 37
VT_UINT_PTR = 38
VT_FILETIME = 64
VT_BLOB = 65
VT_STREAM = 66
VT_STORAGE = 67
VT_STREAMED_OBJECT = 68
VT_STORED_OBJECT = 69
VT_BLOB_OBJECT = 70
VT_CF = 71
VT_CLSID = 72
VT_VERSIONED_STREAM = 73
VT_BSTR_BLOB = $fff
VT_VECTOR = $1000
VT_ARRAY = $2000
VT_BYREF = $4000
VT_RESERVED = $8000
VT_ILLEGAL = $ffff
VT_ILLEGALMASKED = $fff
VT_TYPEMASK = $fff

struct CSPLATFORM
       dwPlatformId dd ?
       dwVersionHi dd ?
       dwVersionLo dd ?
       dwProcessorArch dd ?
ends

struct QUERYCONTEXT
       dwContext dd ?
       Platform CSPLATFORM
       Locale dd ?
       dwVersionHi dd ?
       dwVersionLo dd ?
ends

TYSPEC_CLSID = 0
TYSPEC_FILEEXT = TYSPEC_CLSID + 1
TYSPEC_MIMETYPE = TYSPEC_FILEEXT + 1
TYSPEC_FILENAME = TYSPEC_MIMETYPE + 1
TYSPEC_PROGID = TYSPEC_FILENAME + 1
TYSPEC_PACKAGENAME = TYSPEC_PROGID + 1
TYSPEC_OBJECTID = TYSPEC_PACKAGENAME + 1

;winbase.h -- This module defines the 32-Bit Windows Base APIs
;Copyright (c) Microsoft Corp. All rights reserved.

FILE_BEGIN = 0
FILE_CURRENT = 1
FILE_END = 2

TIME_ZONE_ID_INVALID  = $FFFFFFFF

WAIT_FAILED = $FFFFFFFF
WAIT_OBJECT_0 = STATUS_WAIT_0 + 0
WAIT_ABANDONED = STATUS_ABANDONED_WAIT_0 + 0
WAIT_ABANDONED_0 = STATUS_ABANDONED_WAIT_0 + 0
WAIT_IO_COMPLETION = STATUS_USER_APC

STILL_ACTIVE = STATUS_PENDING
EXCEPTION_ACCESS_VIOLATION = STATUS_ACCESS_VIOLATION
EXCEPTION_DATATYPE_MISALIGNMENT = STATUS_DATATYPE_MISALIGNMENT
EXCEPTION_BREAKPOINT = STATUS_BREAKPOINT
EXCEPTION_SINGLE_STEP = STATUS_SINGLE_STEP
EXCEPTION_ARRAY_BOUNDS_EXCEEDED = STATUS_ARRAY_BOUNDS_EXCEEDED
EXCEPTION_FLT_DENORMAL_OPERAND = STATUS_FLOAT_DENORMAL_OPERAND
EXCEPTION_FLT_DIVIDE_BY_ZERO = STATUS_FLOAT_DIVIDE_BY_ZERO
EXCEPTION_FLT_INEXACT_RESULT = STATUS_FLOAT_INEXACT_RESULT
EXCEPTION_FLT_INVALID_OPERATION = STATUS_FLOAT_INVALID_OPERATION
EXCEPTION_FLT_OVERFLOW = STATUS_FLOAT_OVERFLOW
EXCEPTION_FLT_STACK_CHECK = STATUS_FLOAT_STACK_CHECK
EXCEPTION_FLT_UNDERFLOW = STATUS_FLOAT_UNDERFLOW
EXCEPTION_INT_DIVIDE_BY_ZERO = STATUS_INTEGER_DIVIDE_BY_ZERO
EXCEPTION_INT_OVERFLOW = STATUS_INTEGER_OVERFLOW
EXCEPTION_PRIV_INSTRUCTION = STATUS_PRIVILEGED_INSTRUCTION
EXCEPTION_IN_PAGE_ERROR = STATUS_IN_PAGE_ERROR
EXCEPTION_ILLEGAL_INSTRUCTION = STATUS_ILLEGAL_INSTRUCTION
EXCEPTION_NONCONTINUABLE_EXCEPTION = STATUS_NONCONTINUABLE_EXCEPTION
EXCEPTION_STACK_OVERFLOW = STATUS_STACK_OVERFLOW
EXCEPTION_INVALID_DISPOSITION = STATUS_INVALID_DISPOSITION
EXCEPTION_GUARD_PAGE = STATUS_GUARD_PAGE_VIOLATION
EXCEPTION_INVALID_HANDLE = STATUS_INVALID_HANDLE
EXCEPTION_POSSIBLE_DEADLOCK = STATUS_POSSIBLE_DEADLOCK
CONTROL_C_EXIT = STATUS_CONTROL_C_EXIT

FILE_FLAG_WRITE_THROUGH = $80000000
FILE_FLAG_OVERLAPPED = $40000000
FILE_FLAG_NO_BUFFERING = $20000000
FILE_FLAG_RANDOM_ACCESS = $10000000
FILE_FLAG_SEQUENTIAL_SCAN = $8000000
FILE_FLAG_DELETE_ON_CLOSE = $4000000
FILE_FLAG_BACKUP_SEMANTICS = $2000000
FILE_FLAG_POSIX_SEMANTICS = $1000000
FILE_FLAG_OPEN_REPARSE_POINT = $200000
FILE_FLAG_OPEN_NO_RECALL = $100000
FILE_FLAG_FIRST_PIPE_INSTANCE = $80000

CREATE_NEW = 1
CREATE_ALWAYS = 2
OPEN_EXISTING = 3
OPEN_ALWAYS = 4
TRUNCATE_EXISTING = 5

PROGRESS_CONTINUE = 0
PROGRESS_CANCEL = 1
PROGRESS_STOP = 2
PROGRESS_QUIET = 3

CALLBACK_CHUNK_FINISHED = 0
CALLBACK_STREAM_SWITCH = 1

COPY_FILE_RESTARTABLE = 2
COPY_FILE_OPEN_SOURCE_FOR_WRITE = 4
COPY_FILE_ALLOW_DECRYPTED_DESTINATION = 8

REPLACEFILE_WRITE_THROUGH = 1
REPLACEFILE_IGNORE_MERGE_ERRORS = 2

PIPE_ACCESS_INBOUND = 1
PIPE_ACCESS_OUTBOUND = 2
PIPE_ACCESS_DUPLEX = 3
PIPE_CLIENT_END = 0
PIPE_SERVER_END = 1
PIPE_WAIT = 0
PIPE_NOWAIT = 1
PIPE_READMODE_BYTE = 0
PIPE_READMODE_MESSAGE = 2
PIPE_TYPE_BYTE = 0
PIPE_TYPE_MESSAGE = 4
PIPE_UNLIMITED_INSTANCES = 255

SECURITY_ANONYMOUS = SecurityAnonymous shl 16
SECURITY_IDENTIFICATION = SecurityIdentification shl 16
SECURITY_IMPERSONATION = SecurityImpersonation	shl 16
SECURITY_DELEGATION = SecurityDelegation shl 16
SECURITY_CONTEXT_TRACKING = $40000
SECURITY_EFFECTIVE_ONLY = $80000
SECURITY_SQOS_PRESENT = $100000
SECURITY_VALID_SQOS_FLAGS = $1F0000

struct OVERLAPPED
       Internal dq ?
       InternalHigh dq ?
       union
	   struct
	       Offset dd ?
	       OffsetHigh dd ?
	   ends
	   Pointer dq ?
       ends
       hEvent dq ?
ends

struct PROCESSINFORMATION
       hProcess dq ?
       hThread dq ?
       dwProcessId dd ?
       dwThreadId dd ?
ends

MUTEX_MODIFY_STATE = MUTANT_QUERY_STATE
MUTEX_ALL_ACCESS = MUTANT_ALL_ACCESS

SP_SERIALCOMM = 1

PST_UNSPECIFIED = 0
PST_RS232 = 1
PST_PARALLELPORT = 2
PST_RS422 = 3
PST_RS423 = 4
PST_RS449 = 5
PST_MODEM = 6
PST_FAX = $21
PST_SCANNER = $22
PST_NETWORK_BRIDGE = $100
PST_LAT = $101
PST_TCPIP_TELNET = $102
PST_X25 = $103

PCF_DTRDSR = 1
PCF_RTSCTS = 2
PCF_RLSD = 4
PCF_PARITY_CHECK = 8
PCF_XONXOFF = $10
PCF_SETXCHAR = $20
PCF_TOTALTIMEOUTS = $40
PCF_INTTIMEOUTS = $80
PCF_SPECIALCHARS = $100
PCF_16BITMODE = $200

SP_PARITY = 1
SP_BAUD = 2
SP_DATABITS = 4
SP_STOPBITS = 8
SP_HANDSHAKING = $10
SP_PARITY_CHECK = $20
SP_RLSD = $40

BAUD_075 = 1
BAUD_110 = 2
BAUD_134_5 = 4
BAUD_150 = 8
BAUD_300 = $10
BAUD_600 = $20
BAUD_1200 = $40
BAUD_1800 = $80
BAUD_2400 = $100
BAUD_4800 = $200
BAUD_7200 = $400
BAUD_9600 = $800
BAUD_14400 = $1000
BAUD_19200 = $2000
BAUD_38400 = $4000
BAUD_56K = $8000
BAUD_128K = $10000
BAUD_115200 = $20000
BAUD_57600 = $40000
BAUD_USER = $10000000

DATABITS_5 = 1
DATABITS_6 = 2
DATABITS_7 = 4
DATABITS_8 = 8
DATABITS_16 = $10
DATABITS_16X = $20

STOPBITS_10 = 1
STOPBITS_15 = 2
STOPBITS_20 = 4
PARITY_NONE = $100
PARITY_ODD = $200
PARITY_EVEN = $400
PARITY_MARK = $800
PARITY_SPACE = $1000

struct COMMPROP
       wPacketLength dw ?
       wPacketVersion dw ?
       dwServiceMask dd ?
       dwReserved1 dd ?
       dwMaxTxQueue dd ?
       dwMaxRxQueue dd ?
       dwMaxBaud dd ?
       dwProvSubType dd ?
       dwProvCapabilities dd ?
       dwSettableParams dd ?
       dwSettableBaud dd ?
       wSettableData dw ?
       wSettableStopParity dw ?
       dwCurrentTxQueue dd ?
       dwCurrentRxQueue dd ?
       dwProvSpec1 dd ?
       dwProvSpec2 dd ?
       wcProvChar dw ?,?
ends

COMMPROP_INITIALIZED = $E73CF52E

struct COMSTAT
       union
	   fCtsHold dd ?
	   fDsrHold dd ?
	   fRlsdHold dd ?
	   fXoffHold dd ?
	   fXoffSent dd ?
	   fEof dd ?
	   fTxim dd ?
	   fReserved dd ?
      ends
      cbInQue dd ?
      cbOutQue dd ?
ends

DTR_CONTROL_DISABLE = 0
DTR_CONTROL_ENABLE = 1
DTR_CONTROL_HANDSHAKE = 2

RTS_CONTROL_DISABLE = 0
RTS_CONTROL_ENABLE = 1
RTS_CONTROL_HANDSHAKE = 2
RTS_CONTROL_TOGGLE = 3

struct DCB
       DCBlength dd ?
       BaudRate dd ?
       union
	   fBinary dd ?
	   fParity dd ?
	   fOutxCtsFlow dd ?
	   fOutxDsrFlow dd ?
	   fDtrControl dd ?
	   fDsrSensitivity dd ?
	   fTXContinueOnXoff dd ?
	   fOutX dd ?
	   fInX dd ?
	   fErrorChar dd ?
	   fNull dd ?
	   fRtsControl dd ?
	   fAbortOnError dd ?
	   fDummy2 dd ?
       ends
       wReserved dw ?
       XonLim dw ?
       XoffLim dw ?
       ByteSize db ?
       Parity db ?
       StopBits db ?
       XonChar db ?
       XoffChar db ?
       ErrorChar db ?
       EofChar db ?
       EvtChar db ?
       wReserved1 dw ?
ends

struct COMMTIMEOUTS
       ReadIntervalTimeout dd ?
       ReadTotalTimeoutMultiplier dd ?
       ReadTotalTimeoutConstant dd ?
       WriteTotalTimeoutMultiplier dd ?
       WriteTotalTimeoutConstant dd ?
ends

struct COMMCONFIG
       dwSize dd ?
       wVersion dw ?
       wReserved dw ?
       dcb DCB
       dwProviderSubType dd ?
       dwProviderOffset dd ?
       dwProviderSize dd ?
       wcProviderData dw ?,?
ends

struct SYSTEMINFO
       union
	   dwOemId dd ?
	   struct
	       wProcessorArchitecture dw ?
	       wReserved dw ?
	   ends
       ends
       dwPageSize dd ?
       lpMinimumApplicationAddress dq ?
       lpMaximumApplicationAddress dq ?
       dwActiveProcessorMask dq ?
       dwNumberOfProcessors dd ?
       dwProcessorType dd ?
       dwAllocationGranularity dd ?
       wProcessorLevel dw ?
       wProcessorRevision dw ?
ends

GMEM_FIXED = 0
GMEM_MOVEABLE = 2
GMEM_NOCOMPACT = $10
GMEM_NODISCARD = $20
GMEM_ZEROINIT = $40
GMEM_MODIFY = $80
GMEM_DISCARDABLE = $100
GMEM_NOT_BANKED = $1000
GMEM_SHARE = $2000
GMEM_DDESHARE = $2000
GMEM_NOTIFY = $4000
GMEM_LOWER = GMEM_NOT_BANKED
GMEM_VALID_FLAGS = $7F72
GMEM_INVALID_HANDLE = $8000

GHND = GMEM_MOVEABLE or GMEM_ZEROINIT
GPTR = GMEM_FIXED or GMEM_ZEROINIT

GMEM_DISCARDED = $4000
GMEM_LOCKCOUNT = $FF

struct MEMORYSTATUS
       dwLength dd ?
       dwMemoryLoad dd ?
       dwTotalPhys dq ?
       dwAvailPhys dq ?
       dwTotalPageFile dq ?
       dwAvailPageFile dq ?
       dwTotalVirtual dq ?
       dwAvailVirtual dq ?
ends

LMEM_FIXED = 0
LMEM_MOVEABLE = 2
LMEM_NOCOMPACT = $10
LMEM_NODISCARD = $20
LMEM_ZEROINIT = $40
LMEM_MODIFY = $80
LMEM_DISCARDABLE = $F00
LMEM_VALID_FLAGS = $F72
LMEM_INVALID_HANDLE = $8000

LHND = LMEM_MOVEABLE or LMEM_ZEROINIT
LPTR = LMEM_FIXED or LMEM_ZEROINIT

NONZEROLHND = LMEM_MOVEABLE
NONZEROLPTR = LMEM_FIXED

LMEM_DISCARDED = $4000
LMEM_LOCKCOUNT = $FF

DEBUG_PROCESS = 1
DEBUG_ONLY_THIS_PROCESS = 2
CREATE_SUSPENDED = 4
DETACHED_PROCESS = 8
CREATE_NEW_CONSOLE = $10
NORMAL_PRIORITY_CLASS = $20
IDLE_PRIORITY_CLASS = $40
HIGH_PRIORITY_CLASS = $80
REALTIME_PRIORITY_CLASS = $100
CREATE_NEW_PROCESS_GROUP = $200
CREATE_UNICODE_ENVIRONMENT = $400
CREATE_SEPARATE_WOW_VDM = $800
CREATE_SHARED_WOW_VDM = $1000
CREATE_FORCEDOS = $2000
BELOW_NORMAL_PRIORITY_CLASS = $4000
ABOVE_NORMAL_PRIORITY_CLASS = $8000
STACK_SIZE_PARAM_IS_A_RESERVATION = $10000
CREATE_BREAKAWAY_FROM_JOB = $1000000
CREATE_PRESERVE_CODE_AUTHZ_LEVEL = $2000000
CREATE_DEFAULT_ERROR_MODE = $4000000
CREATE_NO_WINDOW = $8000000
PROFILE_USER = $10000000
PROFILE_KERNEL = $20000000
PROFILE_SERVER = $40000000
CREATE_IGNORE_SYSTEM_DEFAULT = $80000000

THREAD_PRIORITY_LOWEST = THREAD_BASE_PRIORITY_MIN
THREAD_PRIORITY_BELOW_NORMAL = THREAD_PRIORITY_LOWEST + 1
THREAD_PRIORITY_NORMAL = 0
THREAD_PRIORITY_HIGHEST = THREAD_BASE_PRIORITY_MAX
THREAD_PRIORITY_ABOVE_NORMAL = THREAD_PRIORITY_HIGHEST - 1
THREAD_PRIORITY_ERROR_RETURN = MAXLONG
THREAD_PRIORITY_TIME_CRITICAL = THREAD_BASE_PRIORITY_LOWRT
THREAD_PRIORITY_IDLE = THREAD_BASE_PRIORITY_IDLE

EXCEPTION_DEBUG_EVENT = 1
CREATE_THREAD_DEBUG_EVENT = 2
CREATE_PROCESS_DEBUG_EVENT = 3
EXIT_THREAD_DEBUG_EVENT = 4
EXIT_PROCESS_DEBUG_EVENT = 5
LOAD_DLL_DEBUG_EVENT = 6
UNLOAD_DLL_DEBUG_EVENT = 7
OUTPUT_DEBUG_STRING_EVENT = 8
RIP_EVENT = 9

EXCEPTION_NONCONTINUABLE = 1
EXCEPTION_MAXIMUM_PARAMETERS = 15

struct EXCEPTIONPOINTERS
       ExceptionRecord dq ?
       ContextRecord dq ?
ends

struct EXCEPTIONRECORD64
       ExceptionCode dd ?
       ExceptionFlags dd ?
       ExceptionRecord dq ?
       ExceptionAddress dq ?
       NumberParameters dd ?,?
       ExceptionInformation dq EXCEPTION_MAXIMUM_PARAMETERS dup(?)
ends

struct EXCEPTIONDEBUGINFO
       ExceptionRecord EXCEPTIONRECORD64
       dwFirstChance dd ?,?
ends

struct CREATETHREADDEBUGINFO
       hThread dq ?
       lpThreadLocalBase dq ?
       lpStartAddress dq ?
ends

struct CREATEPROCESSDEBUGINFO
       hFile dq ?
       hProcess dq ?
       hThread dq ?
       lpBaseOfImage dq ?
       dwDebugInfoFileOffset dd ?
       nDebugInfoSize dd ?
       lpThreadLocalBase dq ?
       lpStartAddress dq ?
       lpImageName dq ?
       fUnicode dw ?,?,?,?
ends

struct EXITTHREADDEBUGINFO
       dwExitCode dd ?
ends

struct EXITPROCESSDEBUGINFO
       dwExitCode dd ?
ends

struct LOADDLLDEBUGINFO
       hFile dq ?
       lpBaseOfDll dq ?
       dwDebugInfoFileOffset dd ?
       nDebugInfoSize dd ?
       lpImageName dq ?
       fUnicode dw ?,?,?,?
ends

struct UNLOADDLLDEBUGINFO
       lpBaseOfDll dq ?
ends

struct OUTPUTDEBUGSTRINGINFO
       lpDebugStringData dq ?
       fUnicode dw ?
       nDebugStringLength dw ?,?,?
ends

struct RIPINFO
       dwError dd ?
       dwType dd ?
ends


struct DEBUGEVENT
       dwDebugEventCode dd ?
       dwProcessId dd ?
       dwThreadId dd ?
       union
	   Exception  EXCEPTIONDEBUGINFO
	   CreateThread  CREATETHREADDEBUGINFO
	   CreateProcessInfo CREATEPROCESSDEBUGINFO
	   ExitThread  EXITTHREADDEBUGINFO
	   ExitProcess	EXITPROCESSDEBUGINFO
	   LoadDll LOADDLLDEBUGINFO
	   UnloadDll  UNLOADDLLDEBUGINFO
	   DebugString	OUTPUTDEBUGSTRINGINFO
	   RipInfo RIPINFO
       ends
       pad1 dd ?
ends

DRIVE_UNKNOWN = 0
DRIVE_NO_ROOT_DIR = 1
DRIVE_REMOVABLE = 2
DRIVE_FIXED = 3
DRIVE_REMOTE = 4
DRIVE_CDROM = 5
DRIVE_RAMDISK = 6

FILE_TYPE_UNKNOWN = 0
FILE_TYPE_DISK = 1
FILE_TYPE_CHAR = 2
FILE_TYPE_PIPE = 3
FILE_TYPE_REMOTE = $8000

STD_INPUT_HANDLE = -10
STD_OUTPUT_HANDLE = -11
STD_ERROR_HANDLE = -12
INVALID_HANDLE_VALUE = -1

NOPARITY = 0
ODDPARITY = 1
EVENPARITY = 2
MARKPARITY = 3
SPACEPARITY = 4

ONESTOPBIT = 0
ONE5STOPBITS = 1
TWOSTOPBITS = 2

IGNORE = 0
INFINITE = $FFFFFFFF

CBR_110 = 110
CBR_300 = 300
CBR_600 = 600
CBR_1200 = 1200
CBR_2400 = 2400
CBR_4800 = 4800
CBR_9600 = 9600
CBR_14400 = 14400
CBR_19200 = 19200
CBR_38400 = 38400
CBR_56000 = 56000
CBR_57600 = 57600
CBR_115200 = 115200
CBR_128000 = 128000
CBR_256000 = 256000

CE_RXOVER = 1
CE_OVERRUN = 2
CE_RXPARITY = 4
CE_FRAME = 8
CE_BREAK = $10
CE_TXFULL = $100
CE_PTO = $200
CE_IOE = $400
CE_DNS = $800
CE_OOP = $1000
CE_MODE = $8000

IE_BADID = -1
IE_OPEN = -2
IE_NOPEN = -3
IE_MEMORY = -4
IE_DEFAULT = -5
IE_HARDWARE = -10
IE_BYTESIZE = -11
IE_BAUDRATE = -12

EV_RXCHAR = 1
EV_RXFLAG = 2
EV_TXEMPTY = 4
EV_CTS = 8
EV_DSR = $10
EV_RLSD = $20
EV_BREAK = $40
EV_ERR = $80
EV_RING = $100
EV_PERR = $200
EV_RX80FULL = $400
EV_EVENT1 = $800
EV_EVENT2 = $1000

SETXOFF = 1
SETXON = 2
SETRTS = 3
CLRRTS = 4
SETDTR = 5
CLRDTR = 6
RESETDEV = 7
SETBREAK = 8
CLRBREAK = 9

PURGE_TXABORT = 1
PURGE_RXABORT = 2
PURGE_TXCLEAR = 4
PURGE_RXCLEAR = 8

LPTx = $80

MS_CTS_ON = $10
MS_DSR_ON = $20
MS_RING_ON = $40
MS_RLSD_ON = $80

S_QUEUEEMPTY = 0
S_THRESHOLD = 1
S_ALLTHRESHOLD = 2

S_NORMAL = 0
S_LEGATO = 1
S_STACCATO = 2

S_PERIOD512 = 0
S_PERIOD1024 = 1
S_PERIOD2048 = 2
S_PERIODVOICE = 3
S_WHITE512 = 4
S_WHITE1024 = 5
S_WHITE2048 = 6
S_WHITEVOICE = 7

S_SERDVNA = -1
S_SEROFM = -2
S_SERMACT = -3
S_SERQFUL = -4
S_SERBDNT = -5
S_SERDLN = -6
S_SERDCC = -7
S_SERDTP = -8
S_SERDVL = -9
S_SERDMD = -10
S_SERDSH = -11
S_SERDPT = -12
S_SERDFQ = -13
S_SERDDR = -14
S_SERDSR = -15
S_SERDST = -16

NMPWAIT_WAIT_FOREVER = $ffffffff
NMPWAIT_NOWAIT = 1
NMPWAIT_USE_DEFAULT_WAIT = 0

FS_CASE_IS_PRESERVED = FILE_CASE_PRESERVED_NAMES
FS_CASE_SENSITIVE = FILE_CASE_SENSITIVE_SEARCH
FS_UNICODE_STORED_ON_DISK = FILE_UNICODE_ON_DISK
FS_PERSISTENT_ACLS = FILE_PERSISTENT_ACLS
FS_VOL_IS_COMPRESSED = FILE_VOLUME_IS_COMPRESSED
FS_FILE_COMPRESSION = FILE_FILE_COMPRESSION
FS_FILE_ENCRYPTION = FILE_SUPPORTS_ENCRYPTION

FILE_MAP_COPY = SECTION_QUERY
FILE_MAP_WRITE = SECTION_MAP_WRITE
FILE_MAP_READ = SECTION_MAP_READ
FILE_MAP_ALL_ACCESS = SECTION_ALL_ACCESS

OF_READ = 0
OF_WRITE = 1
OF_READWRITE = 2
OF_SHARE_COMPAT = 0
OF_SHARE_EXCLUSIVE = $10
OF_SHARE_DENY_WRITE = $20
OF_SHARE_DENY_READ = $30
OF_SHARE_DENY_NONE = $40
OF_PARSE = $100
OF_DELETE = $200
OF_VERIFY = $400
OF_CANCEL = $800
OF_CREATE = $1000
OF_PROMPT = $2000
OF_EXIST = $4000
OF_REOPEN = $8000
OFS_MAXPATHNAME = 128

struct OFSTRUCT
       cBytes db ?
       fFixedDisk db ?
       nErrCode dw ?
       Reserved1 dw ?
       Reserved2 dw ?
       szPathName db OFS_MAXPATHNAME dup(?)
ends

MAXINTATOM = $C000

struct MEMORYSTATUSEX
       dwLength dd ?
       dwMemoryLoad dd ?
       ullTotalPhys dq ?
       ullAvailPhys dq ?
       ullTotalPageFile dq ?
       ullAvailPageFile dq ?
       ullTotalVirtual dq ?
       ullAvailVirtual dq ?
       ullAvailExtendedVirtual dq ?
ends

struct PROCESSHEAPENTRY
       lpData dq ?
       cbData dd ?
       cbOverhead db ?
       iRegionIndex db ?
       wFlags dw ?
       union
	   struct
	       hMem dq ?
	       dwReserved dd ?,?,?
	   ends
	   struct
	       dwCommittedSize dd ?
	       dwUnCommittedSize dd ?
	       lpFirstBlock dq ?
	       lpLastBlock dq ?
	   ends
       ends
ends

PROCESS_HEAP_REGION = 1
PROCESS_HEAP_UNCOMMITTED_RANGE = 2
PROCESS_HEAP_ENTRY_BUSY = 4
PROCESS_HEAP_ENTRY_MOVEABLE = $10
PROCESS_HEAP_ENTRY_DDESHARE = $20

SCS_32BIT_BINARY = 0
SCS_DOS_BINARY = 1
SCS_WOW_BINARY = 2
SCS_PIF_BINARY = 3
SCS_POSIX_BINARY = 4
SCS_OS216_BINARY = 5
SCS_64BIT_BINARY = 6
SCS_THIS_PLATFORM_BINARY = SCS_32BIT_BINARY

FIBER_FLAG_FLOAT_SWITCH = 1

SEM_FAILCRITICALERRORS = 1
SEM_NOGPFAULTERRORBOX = 2
SEM_NOALIGNMENTFAULTEXCEPT = 4
SEM_NOOPENFILEERRORBOX = $8000

LOCKFILE_FAIL_IMMEDIATELY = 1
LOCKFILE_EXCLUSIVE_LOCK = 2

struct BYHANDLEFILEINFORMATION
       dwFileAttributes dd ?
       ftCreationTime FILETIME
       ftLastAccessTime FILETIME
       ftLastWriteTime FILETIME
       dwVolumeSerialNumber dd ?
       nFileSizeHigh dd ?
       nFileSizeLow dd ?
       nNumberOfLinks dd ?
       nFileIndexHigh dd ?
       nFileIndexLow dd ?
ends

HANDLE_FLAG_INHERIT = 1
HANDLE_FLAG_PROTECT_FROM_CLOSE = 2
HINSTANCE_ERROR = 32

GET_TAPE_MEDIA_INFORMATION = 0
GET_TAPE_DRIVE_INFORMATION = 1
SET_TAPE_MEDIA_INFORMATION = 0
SET_TAPE_DRIVE_INFORMATION = 1

struct TIMEZONEINFORMATION
       Bias dd ?
       StandardName dw 32 dup(?)
       StandardDate SYSTEMTIME
       StandardBias dd ?
       DaylightName dw 32 dup(?)
       DaylightDate SYSTEMTIME
       DaylightBias dd ?
ends

FORMAT_MESSAGE_ALLOCATE_BUFFER = $100
FORMAT_MESSAGE_IGNORE_INSERTS = $200
FORMAT_MESSAGE_FROM_STRING = $400
FORMAT_MESSAGE_FROM_HMODULE = $800
FORMAT_MESSAGE_FROM_SYSTEM = $1000
FORMAT_MESSAGE_ARGUMENT_ARRAY = $2000
FORMAT_MESSAGE_MAX_WIDTH_MASK = $FF

FILE_ENCRYPTABLE = 0
FILE_IS_ENCRYPTED = 1
FILE_SYSTEM_ATTR = 2
FILE_ROOT_DIR = 3
FILE_SYSTEM_DIR = 4
FILE_UNKNOWN = 5
FILE_SYSTEM_NOT_SUPPORT = 6
FILE_USER_DISALLOWED = 7
FILE_READ_ONLY = 8
FILE_DIR_DISALLOWED = 9
EFS_USE_RECOVERY_KEYS = 1

CREATE_FOR_IMPORT = 1
CREATE_FOR_DIR = 2
OVERWRITE_HIDDEN = 4

FLS_OUT_OF_INDEXES = $FFFFFFFF
TLS_OUT_OF_INDEXES = $FFFFFFFF

BACKUP_INVALID = 0
BACKUP_DATA = 1
BACKUP_EA_DATA = 2
BACKUP_SECURITY_DATA = 3
BACKUP_ALTERNATE_DATA = 4
BACKUP_LINK = 5
BACKUP_PROPERTY_DATA = 6
BACKUP_OBJECT_ID = 7
BACKUP_REPARSE_DATA = 8
BACKUP_SPARSE_BLOCK = 9

STREAM_NORMAL_ATTRIBUTE = 0
STREAM_MODIFIED_WHEN_READ = 1
STREAM_CONTAINS_SECURITY = 2
STREAM_CONTAINS_PROPERTIES = 4
STREAM_SPARSE_ATTRIBUTE = 8

STARTF_USESHOWWINDOW = 1
STARTF_USESIZE = 2
STARTF_USEPOSITION = 4
STARTF_USECOUNTCHARS = 8
STARTF_USEFILLATTRIBUTE = $10
STARTF_RUNFULLSCREEN = $20
STARTF_FORCEONFEEDBACK = $40
STARTF_FORCEOFFFEEDBACK = $80
STARTF_USESTDHANDLES = $100
STARTF_USEHOTKEY = $200

struct STARTUPINFOA
       cb dd ?,?
       lpReserved dq ?
       lpDesktop dq ?
       lpTitle dq ?
       dwX dd ?
       dwY dd ?
       dwXSize dd ?
       dwYSize dd ?
       dwXCountChars dd ?
       dwYCountChars dd ?
       dwFillAttribute dd ?
       dwFlags dd ?
       wShowWindow dw ?
       cbReserved2 dw ?,?,?
       lpReserved2 dq ?
       hStdInput dq ?
       hStdOutput dq ?
       hStdError dq ?
ends

struct STARTUPINFOW
       cb dd ?,?
       lpReserved dq ?
       lpDesktop dq ?
       lpTitle dq ?
       dwX dd ?
       dwY dd ?
       dwXSize dd ?
       dwYSize dd ?
       dwXCountChars dd ?
       dwYCountChars dd ?
       dwFillAttribute dd ?
       dwFlags dd ?
       wShowWindow dw ?
       cbReserved2 dw ?,?,?
       lpReserved2 dq ?
       hStdInput dq ?
       hStdOutput dq ?
       hStdError dq ?
ends

struct STARTUPINFOEXA
       StartupInfo STARTUPINFOA
       lpAttributeList dq ?
ends

struct STARTUPINFOEXW
       StartupInfo STARTUPINFOW
       lpAttributeList dq ?
ends

SHUTDOWN_NORETRY = 1

struct WIN32FINDDATAA
       dwFileAttributes dd ?
       ftCreationTime FILETIME
       ftLastAccessTime FILETIME
       ftLastWriteTime FILETIME
       nFileSizeHigh dd ?
       nFileSizeLow dd ?
       dwReserved0 dd ?
       dwReserved1 dd ?
       cFileName db MAX_PATH dup(?)
       cAlternateFileName db 16 dup(?)
ends

struct WIN32FINDDATAW
       dwFileAttributes dd ?
       ftCreationTime FILETIME
       ftLastAccessTime FILETIME
       ftLastWriteTime FILETIME
       nFileSizeHigh dd ?
       nFileSizeLow dd ?
       dwReserved0 dd ?
       dwReserved1 dd ?
       cFileName dw MAX_PATH dup(?)
       cAlternateFileName dw 14 dup(?)
ends

struct WIN32FILEATTRIBUTEDATA
       dwFileAttributes dd ?
       ftCreationTime FILETIME
       ftLastAccessTime FILETIME
       ftLastWriteTime FILETIME
       nFileSizeHigh dd ?
       nFileSizeLow dd ?
ends

DONT_RESOLVE_DLL_REFERENCES = 1
LOAD_LIBRARY_AS_DATAFILE = 2
LOAD_WITH_ALTERED_SEARCH_PATH = 8
LOAD_IGNORE_CODE_AUTHZ_LEVEL = 10

GET_MODULE_HANDLE_EX_FLAG_PIN = 1
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT = 2
GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS = 4

DDD_RAW_TARGET_PATH = 1
DDD_REMOVE_DEFINITION = 2
DDD_EXACT_MATCH_ON_REMOVE = 4
DDD_NO_BROADCAST_SYSTEM = 8
DDD_LUID_BROADCAST_DRIVE = 10

GetFileExInfoStandard = 0
GetFileExMaxInfoLevel = 1

FindExInfoStandard = 0
FindExInfoMaxInfoLevel = 1

FindExSearchNameMatch = 0
FindExSearchLimitToDirectories = 1
FindExSearchLimitToDevices = 2
FindExSearchMaxSearchOp = 3

FIND_FIRST_EX_CASE_SENSITIVE = 1

MOVEFILE_REPLACE_EXISTING = 1
MOVEFILE_COPY_ALLOWED = 2
MOVEFILE_DELAY_UNTIL_REBOOT = 4
MOVEFILE_WRITE_THROUGH = 8
MOVEFILE_CREATE_HARDLINK = $10
MOVEFILE_FAIL_IF_NOT_TRACKABLE = $20

FindStreamInfoStandard = 0
FindStreamInfoMaxInfoLevel = 1

struct WIN32FINDSTREAMDATA
       StreamSize dq ?
       cStreamName dw MAX_PATH+36 dup(?)
ends

EVENTLOG_FULL_INFO = 0

struct EVENTLOGFULLINFORMATION
       dwFull dd ?
ends

ComputerNameNetBIOS = 0
ComputerNameDnsHostname = 1
ComputerNameDnsDomain = 2
ComputerNameDnsFullyQualified = 3
ComputerNamePhysicalNetBIOS = 4
ComputerNamePhysicalDnsHostname = 5
ComputerNamePhysicalDnsDomain = 6
ComputerNamePhysicalDnsFullyQualified = 7
ComputerNameMax = 8

LOGON32_LOGON_INTERACTIVE = 2
LOGON32_LOGON_NETWORK = 3
LOGON32_LOGON_BATCH = 4
LOGON32_LOGON_SERVICE = 5
LOGON32_LOGON_UNLOCK = 7
LOGON32_LOGON_NETWORK_CLEARTEXT = 8
LOGON32_LOGON_NEW_CREDENTIALS = 9
LOGON32_PROVIDER_DEFAULT = 0
LOGON32_PROVIDER_WINNT35 = 1
LOGON32_PROVIDER_WINNT40 = 2
LOGON32_PROVIDER_WINNT50 = 3

LOGON_WITH_PROFILE = 1
LOGON_NETCREDENTIALS_ONLY = 2
LOGON_ZERO_PASSWORD_BUFFER = $80000000

HW_PROFILE_GUIDLEN = 39
MAX_PROFILE_LEN = 80

DOCKINFO_UNDOCKED = 1
DOCKINFO_DOCKED = 2
DOCKINFO_USER_SUPPLIED = 4
DOCKINFO_USER_UNDOCKED = DOCKINFO_USER_SUPPLIED or DOCKINFO_UNDOCKED
DOCKINFO_USER_DOCKED = DOCKINFO_USER_SUPPLIED or DOCKINFO_DOCKED

struct HWPROFILEINFOA
       dwDockInfo dd ?
       szHwProfileGuid db HW_PROFILE_GUIDLEN dup(?)
       szHwProfileName db MAX_PROFILE_LEN+1 dup(?)
ends

struct HWPROFILEINFOW
       dwDockInfo dd ?
       szHwProfileGuid dw HW_PROFILE_GUIDLEN dup(?)
       szHwProfileName dw MAX_PROFILE_LEN+1 dup(?)
ends

TC_NORMAL = 0
TC_HARDERR = 1
TC_GP_TRAP = 2
TC_SIGNAL = 3

AC_LINE_OFFLINE = 0
AC_LINE_ONLINE = 1
AC_LINE_BACKUP_POWER = 2
AC_LINE_UNKNOWN = $FF
BATTERY_FLAG_HIGH = 1
BATTERY_FLAG_LOW = 2
BATTERY_FLAG_CRITICAL = 4
BATTERY_FLAG_CHARGING = 8
BATTERY_FLAG_NO_BATTERY = $80
BATTERY_FLAG_UNKNOWN = $FF
BATTERY_PERCENTAGE_UNKNOWN = $FF
BATTERY_LIFE_UNKNOWN = $FFFFFFFF

struct SYSTEMPOWERSTATUS
       ACLineStatus db ?
       BatteryFlag db ?
       BatteryLifePercent db ?
       Reserved1 db ?
       BatteryLifeTime dd ?
       BatteryFullLifeTime dd ?
ends

ACTCTX_FLAG_PROCESSOR_ARCHITECTURE_VALID = 1
ACTCTX_FLAG_LANGID_VALID = 2
ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID = 4
ACTCTX_FLAG_RESOURCE_NAME_VALID = 8
ACTCTX_FLAG_SET_PROCESS_DEFAULT = $10
ACTCTX_FLAG_APPLICATION_NAME_VALID = $20
ACTCTX_FLAG_SOURCE_IS_ASSEMBLYREF = $40
ACTCTX_FLAG_HMODULE_VALID = $80

struct ACTCTXA
       cbSize dd ?
       dwFlags dd ?
       lpSource dq ?
       wProcessorArchitecture dw ?
       wLangId dw ?,?,?
       lpAssemblyDirectory dq ?
       lpResourceName dq ?
       lpApplicationName dq ?
       hModule dq ?
ends

struct ACTCTXW
       cbSize dd ?
       dwFlags dd ?
       lpSource dq ?
       wProcessorArchitecture dw ?
       wLangId dw ?,?,?
       lpAssemblyDirectory dq ?
       lpResourceName dq ?
       lpApplicationName dq ?
       hModule dq ?
ends

struct ACTCTXSECTIONKEYEDDATA2600
       cbSize dd ?
       ulDataFormatVersion dd ?
       lpData dq ?
       ulLength dd ?,?
       lpSectionGlobalData dq ?
       ulSectionGlobalDataLength dd ?,?
       lpSectionBase dq ?
       ulSectionTotalLength dd ?,?
       hActCtx dq ?
       ulAssemblyRosterIndex dd ?,?
ends

struct ACTCTXSECTIONKEYEDDATAASSEMBLYMETADATA
       lpInformation dq ?
       lpSectionBase dq ?
       ulSectionLength dd ?,?
       lpSectionGlobalDataBase dq ?
       ulSectionGlobalDataLength dd ?,?
ends

struct ACTCTXSECTIONKEYEDDATA
       cbSize dd ?
       ulDataFormatVersion dd ?
       lpData dq ?
       ulLength dd ?,?
       lpSectionGlobalData dq ?
       ulSectionGlobalDataLength dd ?,?
       lpSectionBase dq ?
       ulSectionTotalLength dd ?,?
       hActCtx dq ?
       ulAssemblyRosterIndex dd ?
       ulFlags dd ?
       AssemblyMetadata ACTCTXSECTIONKEYEDDATAASSEMBLYMETADATA
ends

FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX = 1
FIND_ACTCTX_SECTION_KEY_RETURN_FLAGS = 2
FIND_ACTCTX_SECTION_KEY_RETURN_ASSEMBLY_METADATA = 4

struct ACTIVATIONCONTEXTBASICINFORMATION
       hActCtx dq ?
       dwFlags dd ?,?
ends

QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX = 4
QUERY_ACTCTX_FLAG_ACTCTX_IS_HMODULE = 8
QUERY_ACTCTX_FLAG_ACTCTX_IS_ADDRESS = $10
QUERY_ACTCTX_FLAG_NO_ADDREF = $80000000

;MAPIWIN. H
GENERIC_READ = $80000000
GENERIC_WRITE = $40000000
FILE_SHARE_READ = 1
FILE_SHARE_WRITE = 2

FILE_FLAG_SEQUENTIAL_SCAN = $8000000

CREATE_NEW = 1
CREATE_ALWAYS = 2
OPEN_EXISTING = 3
OPEN_ALWAYS = 4
TRUNCATE_EXISTING = 5

INVALID_HANDLE_VALUE = -1
DELETE = $10000

FILE_BEGIN = 0
FILE_CURRENT = 1
FILE_END = 2

FILE_ATTRIBUTE_READONLY = 1
FILE_ATTRIBUTE_HIDDEN = 2
FILE_ATTRIBUTE_SYSTEM = 4
FILE_ATTRIBUTE_DIRECTORY = $10
FILE_ATTRIBUTE_ARCHIVE = $20
FILE_ATTRIBUTE_NORMAL = $80
FILE_ATTRIBUTE_TEMPORARY = $100

FILE_FLAG_WRITE_THROUGH = $80000000
FILE_FLAG_RANDOM_ACCESS = $10000000

TIME_ZONE_ID_INVALID = $FFFFFFFF
TIME_ZONE_ID_UNKNOWN = 0
TIME_ZONE_ID_STANDARD = 1
TIME_ZONE_ID_DAYLIGHT = 2

;#define CRITICAL_SECTION                        ULONG
InitializeCriticalSection = 0
DeleteCriticalSection = 0
EnterCriticalSection = 0
LeaveCriticalSection = 0

;Copyright (c) Microsoft Corporation  All rights reserved.
;winnls.h
;Procedure declarations, constant definitions, and macros for the NLS component.

MAX_LEADBYTES = 12
MAX_DEFAULTCHAR = 2

MB_PRECOMPOSED = 1
MB_COMPOSITE = 2
MB_USEGLYPHCHARS = 4
MB_ERR_INVALID_CHARS = 8

WC_COMPOSITECHECK = $200
WC_DISCARDNS = $10
WC_SEPCHARS = $20
WC_DEFAULTCHAR = $40
WC_NO_BEST_FIT_CHARS = $400

CT_CTYPE1 = 1
CT_CTYPE2 = 2
CT_CTYPE3 = 4

C1_UPPER = 1
C1_LOWER = 2
C1_DIGIT = 4
C1_SPACE = 8
C1_PUNCT = $10
C1_CNTRL = $20
C1_BLANK = $40
C1_XDIGIT = $80
C1_ALPHA = $100
C1_DEFINED = $200

C2_LEFTTORIGHT = 1
C2_RIGHTTOLEFT = 2
C2_EUROPENUMBER = 3
C2_EUROPESEPARATOR = 4
C2_EUROPETERMINATOR = 5
C2_ARABICNUMBER = 6
C2_COMMONSEPARATOR = 7
C2_BLOCKSEPARATOR = 8
C2_SEGMENTSEPARATOR = 9
C2_WHITESPACE = $A
C2_OTHERNEUTRAL = $B
C2_NOTAPPLICABLE = 0

C3_NONSPACING = 1
C3_DIACRITIC = 2
C3_VOWELMARK = 4
C3_SYMBOL = 8
C3_KATAKANA = $10
C3_HIRAGANA = $20
C3_HALFWIDTH = $40
C3_FULLWIDTH = $80
C3_IDEOGRAPH = $100
C3_KASHIDA = $200
C3_LEXICAL = $400
C3_ALPHA = $8000
C3_NOTAPPLICABLE = 0

NORM_IGNORECASE = 1
NORM_IGNORENONSPACE = 2
NORM_IGNORESYMBOLS = 4
NORM_IGNOREKANATYPE = $10000
NORM_IGNOREWIDTH = $20000

MAP_FOLDCZONE = $10
MAP_PRECOMPOSED = $20
MAP_COMPOSITE = $40
MAP_FOLDDIGITS = $80
MAP_EXPAND_LIGATURES = $2000

LCMAP_LOWERCASE = $100
LCMAP_UPPERCASE = $200
LCMAP_SORTKEY = $400
LCMAP_BYTEREV = $800
LCMAP_HIRAGANA = $100000
LCMAP_KATAKANA = $200000
LCMAP_HALFWIDTH = $400000
LCMAP_FULLWIDTH = $800000
LCMAP_LINGUISTIC_CASING = $1000000
LCMAP_SIMPLIFIED_CHINESE = $2000000
LCMAP_TRADITIONAL_CHINESE = $4000000

LGRPID_INSTALLED = 1
LGRPID_SUPPORTED = 2

LCID_INSTALLED = 1
LCID_SUPPORTED = 2
LCID_ALTERNATE_SORTS = 4

CP_INSTALLED = 1
CP_SUPPORTED = 2

SORT_STRINGSORT = $1000

CSTR_LESS_THAN = 1
CSTR_EQUAL = 2
CSTR_GREATER_THAN = 3

CP_ACP = 0
CP_OEMCP = 1
CP_MACCP = 2
CP_THREAD_ACP = 3
CP_SYMBOL = 42
CP_UTF7 = 65000
CP_UTF8 = 65001

CTRY_DEFAULT = 0
CTRY_ALBANIA = 355
CTRY_ALGERIA = 213
CTRY_ARGENTINA = 54
CTRY_ARMENIA = 374
CTRY_AUSTRALIA = 61
CTRY_AUSTRIA = 43
CTRY_AZERBAIJAN = 994
CTRY_BAHRAIN = 973
CTRY_BELARUS = 375
CTRY_BELGIUM = 32
CTRY_BELIZE = 501
CTRY_BOLIVIA = 591
CTRY_BRAZIL = 55
CTRY_BRUNEI_DARUSSALAM = 673
CTRY_BULGARIA = 359
CTRY_CANADA = 2
CTRY_CARIBBEAN = 1
CTRY_CHILE = 56
CTRY_COLOMBIA = 57
CTRY_COSTA_RICA = 506
CTRY_CROATIA = 385
CTRY_CZECH = 420
CTRY_DENMARK = 45
CTRY_DOMINICAN_REPUBLIC = 1
CTRY_ECUADOR = 593
CTRY_EGYPT = 20
CTRY_EL_SALVADOR = 503
CTRY_ESTONIA = 372
CTRY_FAEROE_ISLANDS = 298
CTRY_FINLAND = 358
CTRY_FRANCE = 33
CTRY_GEORGIA = 995
CTRY_GERMANY = 49
CTRY_GREECE = 30
CTRY_GUATEMALA = 502
CTRY_HONDURAS = 504
CTRY_HONG_KONG = 852
CTRY_HUNGARY = 36
CTRY_ICELAND = 354
CTRY_INDIA = 91
CTRY_INDONESIA = 62
CTRY_IRAN = 981
CTRY_IRAQ = 964
CTRY_IRELAND = 353
CTRY_ISRAEL = 972
CTRY_ITALY = 39
CTRY_JAMAICA = 1
CTRY_JAPAN = 81
CTRY_JORDAN = 962
CTRY_KAZAKSTAN = 7
CTRY_KENYA = 254
CTRY_KUWAIT = 965
CTRY_KYRGYZSTAN = 996
CTRY_LATVIA = 371
CTRY_LEBANON = 961
CTRY_LIBYA = 218
CTRY_LIECHTENSTEIN = 41
CTRY_LITHUANIA = 370
CTRY_LUXEMBOURG = 352
CTRY_MACAU = 853
CTRY_MACEDONIA = 389
CTRY_MALAYSIA = 60
CTRY_MALDIVES = 960
CTRY_MEXICO = 52
CTRY_MONACO = 33
CTRY_MONGOLIA = 976
CTRY_MOROCCO = 212
CTRY_NETHERLANDS = 31
CTRY_NEW_ZEALAND = 64
CTRY_NICARAGUA = 505
CTRY_NORWAY = 47
CTRY_OMAN = 968
CTRY_PAKISTAN = 92
CTRY_PANAMA = 507
CTRY_PARAGUAY = 595
CTRY_PERU = 51
CTRY_PHILIPPINES  = 63
CTRY_POLAND = 48
CTRY_PORTUGAL = 351
CTRY_PRCHINA = 86
CTRY_PUERTO_RICO = 1
CTRY_QATAR = 974
CTRY_ROMANIA = 40
CTRY_RUSSIA = 7
CTRY_SAUDI_ARABIA = 966
CTRY_SERBIA = 381
CTRY_SINGAPORE = 65
CTRY_SLOVAK = 421
CTRY_SLOVENIA = 386
CTRY_SOUTH_AFRICA = 27
CTRY_SOUTH_KOREA = 82
CTRY_SPAIN = 34
CTRY_SWEDEN = 46
CTRY_SWITZERLAND = 41
CTRY_SYRIA = 963
CTRY_TAIWAN = 886
CTRY_TATARSTAN = 7
CTRY_THAILAND = 66
CTRY_TRINIDAD_Y_TOBAGO = 1
CTRY_TUNISIA = 216
CTRY_TURKEY = 90
CTRY_UAE = 971
CTRY_UKRAINE = 380
CTRY_UNITED_KINGDOM = 44
CTRY_UNITED_STATES = 1
CTRY_URUGUAY = 598
CTRY_UZBEKISTAN = 7
CTRY_VENEZUELA = 58
CTRY_VIET_NAM = 84
CTRY_YEMEN = 967
CTRY_ZIMBABWE = 263

LOCALE_NOUSEROVERRIDE = $80000000
LOCALE_USE_CP_ACP = $40000000
LOCALE_RETURN_NUMBER = $20000000
LOCALE_ILANGUAGE = 1
LOCALE_SLANGUAGE = 2
LOCALE_SENGLANGUAGE = $1001
LOCALE_SABBREVLANGNAME = 3
LOCALE_SNATIVELANGNAME = 4
LOCALE_ICOUNTRY = 5
LOCALE_SCOUNTRY = 6
LOCALE_SENGCOUNTRY = $1002
LOCALE_SABBREVCTRYNAME = 7
LOCALE_SNATIVECTRYNAME = 8
LOCALE_IDEFAULTLANGUAGE = 9
LOCALE_IDEFAULTCOUNTRY = $A
LOCALE_IDEFAULTCODEPAGE = $B
LOCALE_IDEFAULTANSICODEPAGE = $1004
LOCALE_IDEFAULTMACCODEPAGE = $1011
LOCALE_SLIST = $C
LOCALE_IMEASURE = $D
LOCALE_SDECIMAL = $E
LOCALE_STHOUSAND = $F
LOCALE_SGROUPING = $10
LOCALE_IDIGITS = $11
LOCALE_ILZERO = $12
LOCALE_INEGNUMBER = $1010
LOCALE_SNATIVEDIGITS = $13
LOCALE_SCURRENCY = $14
LOCALE_SINTLSYMBOL = $15
LOCALE_SMONDECIMALSEP = $16
LOCALE_SMONTHOUSANDSEP = $17
LOCALE_SMONGROUPING = $18
LOCALE_ICURRDIGITS = $19
LOCALE_IINTLCURRDIGITS = $1A
LOCALE_ICURRENCY = $1B
LOCALE_INEGCURR = $1C
LOCALE_SDATE = $1D
LOCALE_STIME = $1E
LOCALE_SSHORTDATE = $1F
LOCALE_SLONGDATE = $20
LOCALE_STIMEFORMAT = $1003
LOCALE_IDATE = $21
LOCALE_ILDATE = $22
LOCALE_ITIME = $23
LOCALE_ITIMEMARKPOSN = $1005
LOCALE_ICENTURY = $24
LOCALE_ITLZERO = $25
LOCALE_IDAYLZERO = $26
LOCALE_IMONLZERO = $27
LOCALE_S1159 = $28
LOCALE_S2359 = $29
LOCALE_ICALENDARTYPE = $1009
LOCALE_IOPTIONALCALENDAR = $100B
LOCALE_IFIRSTDAYOFWEEK = $100C
LOCALE_IFIRSTWEEKOFYEAR = $100D
LOCALE_SDAYNAME1 = $2A
LOCALE_SDAYNAME2 = $2B
LOCALE_SDAYNAME3 = $2C
LOCALE_SDAYNAME4 = $2D
LOCALE_SDAYNAME5 = $2E
LOCALE_SDAYNAME6 = $2F
LOCALE_SDAYNAME7 = $30
LOCALE_SABBREVDAYNAME1 = $31
LOCALE_SABBREVDAYNAME2 = $32
LOCALE_SABBREVDAYNAME3 = $33
LOCALE_SABBREVDAYNAME4 = $34
LOCALE_SABBREVDAYNAME5 = $35
LOCALE_SABBREVDAYNAME6 = $36
LOCALE_SABBREVDAYNAME7 = $37
LOCALE_SMONTHNAME1 = $38
LOCALE_SMONTHNAME2 = $39
LOCALE_SMONTHNAME3 = $3A
LOCALE_SMONTHNAME4 = $3B
LOCALE_SMONTHNAME5 = $3C
LOCALE_SMONTHNAME6 = $3D
LOCALE_SMONTHNAME7 = $3E
LOCALE_SMONTHNAME8 = $3F
LOCALE_SMONTHNAME9 = $40
LOCALE_SMONTHNAME10 = $41
LOCALE_SMONTHNAME11 = $42
LOCALE_SMONTHNAME12 = $43
LOCALE_SMONTHNAME13 = $100E
LOCALE_SABBREVMONTHNAME1 = $44
LOCALE_SABBREVMONTHNAME2 = $45
LOCALE_SABBREVMONTHNAME3 = $46
LOCALE_SABBREVMONTHNAME4 = $47
LOCALE_SABBREVMONTHNAME5 = $48
LOCALE_SABBREVMONTHNAME6 = $49
LOCALE_SABBREVMONTHNAME7 = $4A
LOCALE_SABBREVMONTHNAME8 = $4B
LOCALE_SABBREVMONTHNAME9 = $4C
LOCALE_SABBREVMONTHNAME10 = $4D
LOCALE_SABBREVMONTHNAME11 = $4E
LOCALE_SABBREVMONTHNAME12 = $4F
LOCALE_SABBREVMONTHNAME13 = $100F
LOCALE_SPOSITIVESIGN = $50
LOCALE_SNEGATIVESIGN = $51
LOCALE_IPOSSIGNPOSN = $52
LOCALE_INEGSIGNPOSN = $53
LOCALE_IPOSSYMPRECEDES = $54
LOCALE_IPOSSEPBYSPACE = $55
LOCALE_INEGSYMPRECEDES = $56
LOCALE_INEGSEPBYSPACE = $57
LOCALE_FONTSIGNATURE = $58
LOCALE_SISO639LANGNAME = $59
LOCALE_SISO3166CTRYNAME = $5A
LOCALE_IDEFAULTEBCDICCODEPAGE = $1012
LOCALE_IPAPERSIZE = $100A
LOCALE_SENGCURRNAME = $1007
LOCALE_SNATIVECURRNAME = $1008
LOCALE_SYEARMONTH = $1006
LOCALE_SSORTNAME = $1013
LOCALE_IDIGITSUBSTITUTION = $1014

TIME_NOMINUTESORSECONDS = 1
TIME_NOSECONDS = 2
TIME_NOTIMEMARKER = 4
TIME_FORCE24HOURFORMAT = 8

DATE_SHORTDATE = 1
DATE_LONGDATE = 2
DATE_USE_ALT_CALENDAR = 4
DATE_YEARMONTH = 8
DATE_LTRREADING = $10
DATE_RTLREADING = $20

CAL_NOUSEROVERRIDE = LOCALE_NOUSEROVERRIDE
CAL_USE_CP_ACP = LOCALE_USE_CP_ACP
CAL_RETURN_NUMBER = LOCALE_RETURN_NUMBER
CAL_ICALINTVALUE = 1
CAL_SCALNAME = 2
CAL_IYEAROFFSETRANGE = 3
CAL_SERASTRING = 4
CAL_SSHORTDATE = 5
CAL_SLONGDATE = 6
CAL_SDAYNAME1 = 7
CAL_SDAYNAME2 = 8
CAL_SDAYNAME3 = 9
CAL_SDAYNAME4 = $a
CAL_SDAYNAME5 = $b
CAL_SDAYNAME6 = $c
CAL_SDAYNAME7 = $d
CAL_SABBREVDAYNAME1 = $e
CAL_SABBREVDAYNAME2 = $f
CAL_SABBREVDAYNAME3 = $10
CAL_SABBREVDAYNAME4 = $11
CAL_SABBREVDAYNAME5 = $12
CAL_SABBREVDAYNAME6 = $13
CAL_SABBREVDAYNAME7 = $14
CAL_SMONTHNAME1 = $15
CAL_SMONTHNAME2 = $16
CAL_SMONTHNAME3 = $17
CAL_SMONTHNAME4 = $18
CAL_SMONTHNAME5 = $19
CAL_SMONTHNAME6 = $1a
CAL_SMONTHNAME7 = $1b
CAL_SMONTHNAME8 = $1c
CAL_SMONTHNAME9 = $1d
CAL_SMONTHNAME10 = $1e
CAL_SMONTHNAME11 = $1f
CAL_SMONTHNAME12 = $20
CAL_SMONTHNAME13 = $21
CAL_SABBREVMONTHNAME1 = $22
CAL_SABBREVMONTHNAME2 = $23
CAL_SABBREVMONTHNAME3 = $24
CAL_SABBREVMONTHNAME4 = $25
CAL_SABBREVMONTHNAME5 = $26
CAL_SABBREVMONTHNAME6 = $27
CAL_SABBREVMONTHNAME7 = $28
CAL_SABBREVMONTHNAME8 = $29
CAL_SABBREVMONTHNAME9 = $2a
CAL_SABBREVMONTHNAME10 = $2b
CAL_SABBREVMONTHNAME11 = $2c
CAL_SABBREVMONTHNAME12 = $2d
CAL_SABBREVMONTHNAME13 = $2e
CAL_SYEARMONTH = $2f
CAL_ITWODIGITYEARMAX = $30

ENUM_ALL_CALENDARS = $ffffffff

CAL_GREGORIAN = 1
CAL_GREGORIAN_US = 2
CAL_JAPAN = 3
CAL_TAIWAN = 4
CAL_KOREA = 5
CAL_HIJRI = 6
CAL_THAI = 7
CAL_HEBREW = 8
CAL_GREGORIAN_ME_FRENCH = 9
CAL_GREGORIAN_ARABIC = 10
CAL_GREGORIAN_XLIT_ENGLISH = 11
CAL_GREGORIAN_XLIT_FRENCH = 12

LGRPID_WESTERN_EUROPE = 1
LGRPID_CENTRAL_EUROPE = 2
LGRPID_BALTIC = 3
LGRPID_GREEK = 4
LGRPID_CYRILLIC = 5
LGRPID_TURKISH = 6
LGRPID_JAPANESE = 7
LGRPID_KOREAN = 8
LGRPID_TRADITIONAL_CHINESE = 9
LGRPID_SIMPLIFIED_CHINESE = $a
LGRPID_THAI = $b
LGRPID_HEBREW = $c
LGRPID_ARABIC = $d
LGRPID_VIETNAMESE = $e
LGRPID_INDIC = $f
LGRPID_GEORGIAN = $10
LGRPID_ARMENIAN = $11

struct CPINFO
       MaxCharSize dd ?
       DefaultChar db MAX_DEFAULTCHAR dup(?)
       LeadByte db MAX_LEADBYTES+2 dup(?)
ends

struct CPINFOEXA
       MaxCharSize dd ?
       DefaultChar db MAX_DEFAULTCHAR dup(?)
       LeadByte db MAX_LEADBYTES dup(?)
       UnicodeDefaultChar dw ?
       CodePage dd ?
       CodePageName db MAX_PATH dup(?)
ends

struct CPINFOEXW
       MaxCharSize dd ?
       DefaultChar db MAX_DEFAULTCHAR dup(?)
       LeadByte db MAX_LEADBYTES dup(?)
       UnicodeDefaultChar dw ?
       CodePage dd ?
       CodePageName dw MAX_PATH dup(?)
ends

struct NUMBERFMT
       NumDigits dd ?
       LeadingZero dd ?
       Grouping dd ?,?
       lpDecimalSep dq ?
       lpThousandSep dq ?
       NegativeOrder dd ?,?
ends

struct CURRENCYFMT
       NumDigits dd ?
       LeadingZero dd ?
       Grouping dd ?,?
       lpDecimalSep dq ?
       lpThousandSep dq ?
       NegativeOrder dd ?
       PositiveOrder dd ?
       lpCurrencySymbol dq ?
ends

COMPARE_STRING = 1

struct NLSVERSIONINFO
       dwNLSVersionInfoSize dd ?
       dwNLSVersion dd ?
       dwDefinedVersion dd ?
ends

GEOID_NOT_AVAILABLE = -1

GEO_NATION = 1
GEO_LATITUDE = 2
GEO_LONGITUDE = 3
GEO_ISO2 = 4
GEO_ISO3 = 5
GEO_RFC1766 = 6
GEO_LCID = 7
GEO_FRIENDLYNAME = 8
GEO_OFFICIALNAME = 9
GEO_TIMEZONES	= $A
GEO_OFFICIALLANGUAGES = $B

GEOCLASS_NATION = 16
GEOCLASS_REGION = 14

struct MODULEINFO
       lpBaseOfDll dq ?
       SizeOfImage dd ?,?
       EntryPoint dq ?
ends

struct PSAPIWSWATCHINFORMATION
       FaultingPc dq ?
       FaultingVa dq ?
ends

struct PROCESSMEMORYCOUNTERS
       cb dd ?
       PageFaultCount dd ?
       PeakWorkingSetSize dq ?
       WorkingSetSize dq ?
       QuotaPeakPagedPoolUsage dq ?
       QuotaPagedPoolUsage dq ?
       QuotaPeakNonPagedPoolUsage dq ?
       QuotaNonPagedPoolUsage dq ?
       PagefileUsage dq ?
       PeakPagefileUsage dq ?
ends

struct PROCESSMEMORYCOUNTERSEX
       cb dd ?
       PageFaultCount dd ?
       PeakWorkingSetSize dq ?
       WorkingSetSize dq ?
       QuotaPeakPagedPoolUsage dq ?
       QuotaPagedPoolUsage dq ?
       QuotaPeakNonPagedPoolUsage dq ?
       QuotaNonPagedPoolUsage dq ?
       PagefileUsage dq ?
       PeakPagefileUsage dq ?
       PrivateUsage dq ?
ends

struct PERFORMANCEINFORMATION
       cb dd ?,?
       CommitTotal dq ?
       CommitLimit dq ?
       CommitPeak dq ?
       PhysicalTotal dq ?
       PhysicalAvailable dq ?
       SystemCache dq ?
       KernelTotal dq ?
       KernelPaged dq ?
       KernelNonpaged dq ?
       PageSize dq ?
       HandleCount dd ?
       ProcessCount dd ?
       ThreadCount dd ?,?
ends

struct ENUMPAGEFILEINFORMATION
       cb dd ?
       Reserved dd ?
       TotalSize dq ?
       TotalInUse dq ?
       PeakUsage dq ?
ends

;winternl.h -- This module defines the internal NT APIs and data
;    structures that are intended for the use only by internal core
;    Windows components.  These APIs and data structures may change
;    at any time.
;
;These APIs and data structures are subject to changes from one
;    Windows release to another Windows release.  To maintain the
;    compatiblity of your application, avoid using these APIs and
;    data structures.
;
;The appropriate mechanism for accessing the functions defined in
;    this header is to use LoadLibrary() for ntdll.dll and
;    GetProcAddress() for the particular function.  By using this
;    approach, your application will be more resilient to changes
;    for these functions between Windows releases.  If a function
;    prototype does change, then GetProcAddress() for that function
;    might detect the change and fail the function call, which your
;    application will be able to detect.  GetProcAddress() may not
;    be able to detect all signature changes, thus avoid using these
;    internal functions.  Instead, your application should use the
;    appropriate Win32 function that provides equivalent or similiar
;    functionality.
;
;Copyright (c) Microsoft Corp. All rights reserved.

;These data structures and type definitions are needed for compilation and
;use of the internal Windows APIs defined in this header.
struct STRING
       Length dw ?
       MaximumLength dw ?,?,?
       Buffer dq ?
ends

struct UNICODESTRING
       Length dw ?
       MaximumLength dw ?,?,?
       Buffer dq ?
ends

;The PEB_LDR_DATA, LDR_DATA_TABLE_ENTRY, RTL_USER_PROCESS_PARAMETERS, PEB
;and TEB structures are subject to changes between Windows releases; thus,
;the field offsets and reserved fields may change. The reserved fields are
;reserved for use only by the Windows operating systems. Do not assume a
;maximum size for these structures.
;
;Instead of using the InMemoryOrderModuleList field of the
;    LDR_DATA_TABLE_ENTRY structure, use the Win32 API EnumProcessModules
;
;Instead of using the IsBeingDebugged field of the PEB structure, use the
;    Win32 APIs IsDebuggerPresent or CheckRemoteDebuggerPresent
;
;Instead of using the SessionId field of the PEB structure, use the Win32
;    APIs GetCurrentProcessId and ProcessIdToSessionId
;
;Instead of using the Tls fields of the TEB structure, use the Win32 APIs
;    TlsAlloc, TlsGetValue, TlsSetValue and TlsFree
;
;Instead of using the ReservedForOle field, use the COM API
;    CoGetContextToken
;
;Sample x86 assembly code that gets the SessionId (subject to change
;    between Windows releases, use the Win32 APIs to make your application
;    resilient to changes)
;    mov     eax,fs:[00000018]
;    mov     eax,[eax+0x30]
;    mov     eax,[eax+0x1d4]
struct PEBLDRDATA
       Reserved1 db 8 dup(?)
       Reserved2 dq 3 dup(?)
       InMemoryOrderModuleList LISTENTRY64
ends

struct LDRDATATABLEENTRY
       Reserved1 dq 2 dup(?)
       InMemoryOrderLinks LISTENTRY64
       Reserved2 dq 2 dup(?)
       DllBase dq ?
       Reserved3 dq 2 dup(?)
       FullDllName UNICODESTRING
       Reserved4 db 8 dup(?)
       Reserved5 dq 3 dup(?)
       union
	   CheckSum dd ?
	   Reserved6 dq ?
       ends
       TimeDateStamp dd ?,?
ends

struct RTLUSERPROCESSPARAMETERS
       Reserved1 db 16 dup(?)
       Reserved2 dq 10 dup(?)
       ImagePathName UNICODESTRING
       CommandLine UNICODESTRING
ends

struct PEB
       Reserved1 db ?,?
       BeingDebugged db ?
       Reserved2 db ?,?,?,?,?
       Reserved3 dq ?,?
       Ldr dq ?
       ProcessParameters dd ?
       Reserved4 db 108 dup(?)
       Reserved5 dq 52 dup(?)
       PostProcessInitRoutine dq ?
       Reserved6 db 128 dup(?)
       Reserved7 dq ?
       SessionId dd ?,?
ends

struct TEB
       Reserved1 db 1952 dup(?)
       Reserved2 dq 412 dup(?)
       TlsSlots dq 64 dup(?)
       Reserved3 db 8 dup(?)
       Reserved4 dq 26 dup(?)
       ReservedForOle dq ? ;Windows 2000 only
       Reserved5 dq 4 dup(?)
       TlsExpansionSlots dq ?
ends

struct OBJECTATTRIBUTES
       Length dd ?,?
       RootDirectory dq ?
       ObjectName dq ?
       Attributes dd ?,?
       SecurityDescriptor dq ?
       SecurityQualityOfService dq ?
ends

struct IOSTATUSBLOCK
       union
	   Status dd ?
	   Pointer dq ?
       ends
       Information dq ?
ends

struct PROCESSBASICINFORMATION
       Reserved1 dq ?
       PebBaseAddress dq ?
       Reserved2 dq ?,?
       UniqueProcessId dq ?
       Reserved3 dq ?
ends

struct SYSTEMPROCESSORPERFORMANCEINFORMATION
       IdleTime dq ?
       KernelTime dq ?
       UserTime dq ?
       Reserved1 dq ?,?
       Reserved2 dd ?,?
ends

struct SYSTEMPROCESSINFORMATION
       NextEntryOffset dd ?
       Reserved1 db 52 dup(?)
       Reserved2 dq ?,?,?
       UniqueProcessId dq ?
       Reserved3 dq ?
       HandleCount dd ?
       Reserved4 db 4 dup(?)
       Reserved5 dq 11 dup(?)
       PeakPagefileUsage dq ?
       PrivatePageCount dq ?
       Reserved6 dq 6 dup(?)
ends

struct SYSTEMREGISTRYQUOTAINFORMATION
       RegistryQuotaAllowed dd ?
       RegistryQuotaUsed dd ?
       Reserved1 dq ?
ends

struct SYSTEMBASICINFORMATION
       Reserved1 db 24 dup(?)
       Reserved2 dq 4 dup(?)
       NumberOfProcessors db 8 dup(?)
ends

struct SYSTEMTIMEOFDAYINFORMATION
       Reserved1 db 48 dup(?)
ends

struct SYSTEMPERFORMANCEINFORMATION
       Reserved1 db 312 dup(?)
ends

struct SYSTEMEXCEPTIONINFORMATION
       Reserved1 db 16 dup(?)
ends

struct SYSTEMLOOKASIDEINFORMATION
       Reserved1 db 32 dup(?)
ends

struct SYSTEMINTERRUPTINFORMATION
       Reserved1 db 24 dup(?)
ends

FileDirectoryInformation = 1

ProcessBasicInformation = 0
ProcessWow64Information = 26

ThreadIsIoPending = 16

SystemBasicInformation = 0
SystemPerformanceInformation = 2
SystemTimeOfDayInformation = 3
SystemProcessInformation = 5
SystemProcessorPerformanceInformation = 8
SystemInterruptInformation = 23
SystemExceptionInformation = 33
SystemRegistryQuotaInformation = 37
SystemLookasideInformation = 45

ObjectBasicInformation = 0
ObjectTypeInformation = 2

struct PUBLICOBJECTBASICINFORMATION
       Attributes dd ?
       GrantedAccess dd ?
       HandleCount dd ?
       PointerCount dd ?
       Reserved dd 10 dup(?)
ends

struct PUBLICOBJECTTYPEINFORMATION
       TypeName UNICODESTRING
       Reserved dd 22 dup(?)
ends

;use the WTS API instead
;     WTSGetActiveConsoleSessionId
;The active console id is cached as a volatile ULONG in a constant
;memory location.  This x86 memory location is subject to changes between
;Windows releases.  Use the WTS API to make your application resilient to
;changes.
INTERNAL_TS_ACTIVE_CONSOLE_ID = $7ffe02d8

LOGONID_CURRENT = -1
SERVERNAME_CURRENT = NULL

WinStationInformation = 8

struct WINSTATIONINFORMATIONW
       Reserved2 db 70 dup(?)
       LogonId dd ?
       Reserved3 db 1142 dup(?)
ends


;wingdi.h, wincon.h -- GDI procedure declarations, constant definitions and macros
;Copyright (c) Microsoft Corp. All rights reserved.

R2_BLACK = 1
R2_NOTMERGEPEN = 2
R2_MASKNOTPEN = 3
R2_NOTCOPYPEN = 4
R2_MASKPENNOT = 5
R2_NOT = 6
R2_XORPEN = 7
R2_NOTMASKPEN = 8
R2_MASKPEN = 9
R2_NOTXORPEN = 10
R2_NOP = 11
R2_MERGENOTPEN = 12
R2_COPYPEN = 13
R2_MERGEPENNOT = 14
R2_MERGEPEN = 15
R2_WHITE = 16
R2_LAST = 16

SRCCOPY = $CC0020
SRCPAINT = $EE0086
SRCAND = $8800C6
SRCINVERT = $660046
SRCERASE = $440328
NOTSRCCOPY = $330008
NOTSRCERASE = $1100A6
MERGECOPY = $C000CA
MERGEPAINT = $BB0226
PATCOPY = $F00021
PATPAINT = $FB0A09
PATINVERT = $5A0049
DSTINVERT = $550009
BLACKNESS = $000042
WHITENESS = $FF0062
NOMIRRORBITMAP = $80000000
CAPTUREBLT = $40000000

;MAKEROP4(fore,back) (DWORD)((((back) << 8) & 0xFF000000) | (fore))

GDI_ERROR = $FFFFFFFF
HGDI_ERROR = $FFFFFFFF

ERROR = 0
NULLREGION = 1
SIMPLEREGION = 2
COMPLEXREGION = 3
RGN_ERROR = ERROR

RGN_AND = 1
RGN_OR = 2
RGN_XOR = 3
RGN_DIFF = 4
RGN_COPY = 5
RGN_MIN = RGN_AND
RGN_MAX = RGN_COPY

BLACKONWHITE = 1
WHITEONBLACK = 2
COLORONCOLOR = 3
HALFTONE = 4
MAXSTRETCHBLTMODE = 4
STRETCH_ANDSCANS = BLACKONWHITE
STRETCH_ORSCANS = WHITEONBLACK
STRETCH_DELETESCANS = COLORONCOLOR
STRETCH_HALFTONE = HALFTONE

ALTERNATE = 1
WINDING = 2
POLYFILL_LAST = 2

LAYOUT_RTL = 1
LAYOUT_BTT = 2
LAYOUT_VBH = 4
LAYOUT_ORIENTATIONMASK = LAYOUT_RTL or LAYOUT_BTT or LAYOUT_VBH
LAYOUT_BITMAPORIENTATIONPRESERVED = 8

TA_NOUPDATECP = 0
TA_UPDATECP = 1

TA_LEFT = 0
TA_RIGHT = 2
TA_CENTER = 6

TA_TOP = 0
TA_BOTTOM = 8
TA_BASELINE = 24
TA_RTLREADING = 256
TA_MASK = TA_BASELINE + TA_CENTER + TA_UPDATECP + TA_RTLREADING
TA_MASK = TA_BASELINE + TA_CENTER + TA_UPDATECP

VTA_BASELINE = TA_BASELINE
VTA_LEFT = TA_BOTTOM
VTA_RIGHT = TA_TOP
VTA_CENTER = TA_CENTER
VTA_BOTTOM = TA_RIGHT
VTA_TOP = TA_LEFT

ETO_OPAQUE = 2
ETO_CLIPPED = 4
ETO_GLYPH_INDEX = 10
ETO_RTLREADING = 80
ETO_NUMERICSLOCAL = 400
ETO_NUMERICSLATIN = 800
ETO_IGNORELANGUAGE = 1000
ETO_PDY = 2000

ASPECT_FILTERING = 1

DCB_RESET = 1
DCB_ACCUMULATE = 2
DCB_DIRTY = DCB_ACCUMULATE
DCB_SET = DCB_RESET or DCB_ACCUMULATE
DCB_ENABLE = 4
DCB_DISABLE = 8

META_SETBKCOLOR = $201
META_SETBKMODE = $102
META_SETMAPMODE = $103
META_SETROP2 = $104
META_SETRELABS = $105
META_SETPOLYFILLMODE = $106
META_SETSTRETCHBLTMODE = $107
META_SETTEXTCHAREXTRA = $108
META_SETTEXTCOLOR = $209
META_SETTEXTJUSTIFICATION = $20A
META_SETWINDOWORG = $20B
META_SETWINDOWEXT = $20C
META_SETVIEWPORTORG = $20D
META_SETVIEWPORTEXT = $20E
META_OFFSETWINDOWORG = $20F
META_SCALEWINDOWEXT = $410
META_OFFSETVIEWPORTORG = $211
META_SCALEVIEWPORTEXT = $412
META_LINETO = $213
META_MOVETO = $214
META_EXCLUDECLIPRECT = $415
META_INTERSECTCLIPRECT = $416
META_ARC = $817
META_ELLIPSE = $418
META_FLOODFILL = $419
META_PIE = $81A
META_RECTANGLE = $41B
META_ROUNDRECT = $61C
META_PATBLT = $61D
META_SAVEDC = $01E
META_SETPIXEL = $41F
META_OFFSETCLIPRGN = $220
META_TEXTOUT = $521
META_BITBLT = $922
META_STRETCHBLT = $B23
META_POLYGON = $324
META_POLYLINE = $325
META_ESCAPE = $626
META_RESTOREDC = $127
META_FILLREGION = $228
META_FRAMEREGION = $429
META_INVERTREGION = $12A
META_PAINTREGION = $12B
META_SELECTCLIPREGION = $12C
META_SELECTOBJECT = $12D
META_SETTEXTALIGN = $12E
META_CHORD = $830
META_SETMAPPERFLAGS = $231
META_EXTTEXTOUT = $a32
META_SETDIBTODEV = $d33
META_SELECTPALETTE = $234
META_REALIZEPALETTE = $035
META_ANIMATEPALETTE = $436
META_SETPALENTRIES = $037
META_POLYPOLYGON = $538
META_RESIZEPALETTE = $139
META_DIBBITBLT = $940
META_DIBSTRETCHBLT = $b41
META_DIBCREATEPATTERNBRUSH   = $142
META_STRETCHDIB = $f43
META_EXTFLOODFILL = $548
META_SETLAYOUT = $149
META_DELETEOBJECT = $1f0
META_CREATEPALETTE = $0f7
META_CREATEPATTERNBRUSH = $1F9
META_CREATEPENINDIRECT = $2FA
META_CREATEFONTINDIRECT = $2FB
META_CREATEBRUSHINDIRECT = $2FC
META_CREATEREGION = $6FF

struct DRAWPATRECT
       ptPosition POINT
       ptSize POINT
       wStyle dw ?
       wPattern dw ?
ends

NEWFRAME = 1
ABORTDOC = 2
NEXTBAND = 3
SETCOLORTABLE = 4
GETCOLORTABLE = 5
FLUSHOUTPUT = 6
DRAFTMODE = 7
QUERYESCSUPPORT = 8
SETABORTPROC = 9
STARTDOC = 10
ENDDOC = 11
GETPHYSPAGESIZE = 12
GETPRINTINGOFFSET = 13
GETSCALINGFACTOR = 14
MFCOMMENT = 15
GETPENWIDTH = 16
SETCOPYCOUNT = 17
SELECTPAPERSOURCE = 18
DEVICEDATA = 19
PASSTHROUGH = 19
GETTECHNOLGY = 20
GETTECHNOLOGY = 20
SETLINECAP = 21
SETLINEJOIN = 22
SETMITERLIMIT = 23
BANDINFO = 24
DRAWPATTERNRECT = 25
GETVECTORPENSIZE = 26
GETVECTORBRUSHSIZE = 27
ENABLEDUPLEX = 28
GETSETPAPERBINS = 29
GETSETPRINTORIENT  = 30
ENUMPAPERBINS = 31
SETDIBSCALING = 32
EPSPRINTING = 33
ENUMPAPERMETRICS = 34
GETSETPAPERMETRICS = 35
POSTSCRIPT_DATA = 37
POSTSCRIPT_IGNORE  = 38
MOUSETRAILS = 39
GETDEVICEUNITS = 42

GETEXTENDEDTEXTMETRICS = 256
GETEXTENTTABLE = 257
GETPAIRKERNTABLE = 258
GETTRACKKERNTABLE = 259
EXTTEXTOUT = 512
GETFACENAME = 513
DOWNLOADFACE = 514
ENABLERELATIVEWIDTHS = 768
ENABLEPAIRKERNING = 769
SETKERNTRACK = 770
SETALLJUSTVALUES = 771
SETCHARSET = 772

STRETCHBLT = 2048
METAFILE_DRIVER = 2049
GETSETSCREENPARAMS = 3072
QUERYDIBSUPPORT = 3073
BEGIN_PATH = 4096
CLIP_TO_PATH = 4097
END_PATH = 4098
EXT_DEVICE_CAPS = 4099
RESTORE_CTM = 4100
SAVE_CTM = 4101
SET_ARC_DIRECTION = 4102
SET_BACKGROUND_COLOR = 4103
SET_POLY_MODE = 4104
SET_SCREEN_ANGLE = 4105
SET_SPREAD = 4106
TRANSFORM_CTM = 4107
SET_CLIP_BOX = 4108
SET_BOUNDS = 4109
SET_MIRROR_MODE = 4110
OPENCHANNEL = 4110
DOWNLOADHEADER = 4111
CLOSECHANNEL = 4112
POSTSCRIPT_PASSTHROUGH = 4115
ENCAPSULATED_POSTSCRIPT = 4116
POSTSCRIPT_IDENTIFY = 4117
POSTSCRIPT_INJECTION = 4118
CHECKJPEGFORMAT = 4119
CHECKPNGFORMAT = 4120
GET_PS_FEATURESETTING = 4121
SPCLPASSTHROUGH2 = 4568

PSIDENT_GDICENTRIC = 0
PSIDENT_PSCENTRIC = 1

struct PSINJECTDATA
       DataBytes dd ?
       InjectionPoint dw ?
       PageNumber dw ?
ends

PSINJECT_BEGINSTREAM = 1
PSINJECT_PSADOBE = 2
PSINJECT_PAGESATEND = 3
PSINJECT_PAGES = 4
PSINJECT_DOCNEEDEDRES = 5
PSINJECT_DOCSUPPLIEDRES = 6
PSINJECT_PAGEORDER = 7
PSINJECT_ORIENTATION = 8
PSINJECT_BOUNDINGBOX = 9
PSINJECT_DOCUMENTPROCESSCOLORS = 10
PSINJECT_COMMENTS = 11
PSINJECT_BEGINDEFAULTS = 12
PSINJECT_ENDDEFAULTS = 13
PSINJECT_BEGINPROLOG = 14
PSINJECT_ENDPROLOG = 15
PSINJECT_BEGINSETUP = 16
PSINJECT_ENDSETUP = 17
PSINJECT_TRAILER = 18
PSINJECT_EOF = 19
PSINJECT_ENDSTREAM = 20
PSINJECT_DOCUMENTPROCESSCOLORSATEND = 21
PSINJECT_PAGENUMBER = 100
PSINJECT_BEGINPAGESETUP = 101
PSINJECT_ENDPAGESETUP = 102
PSINJECT_PAGETRAILER = 103
PSINJECT_PLATECOLOR = 104
PSINJECT_SHOWPAGE = 105
PSINJECT_PAGEBBOX = 106
PSINJECT_ENDPAGECOMMENTS = 107
PSINJECT_VMSAVE = 200
PSINJECT_VMRESTORE = 201

FEATURESETTING_NUP = 0
FEATURESETTING_OUTPUT = 1
FEATURESETTING_PSLEVEL = 2
FEATURESETTING_CUSTPAPER = 3
FEATURESETTING_MIRROR = 4
FEATURESETTING_NEGATIVE = 5
FEATURESETTING_PROTOCOL = 6

FEATURESETTING_PRIVATE_BEGIN = $1000
FEATURESETTING_PRIVATE_END = $1FFF

struct PSFEATUREOUTPUT
       bPageIndependent dd ?
       bSetPageDevice dd ?
ends

struct PSFEATURECUSTPAPER
       lOrientation dd ?
       lWidth dd ?
       lHeight dd ?
       lWidthOffset dd ?
       lHeightOffset dd ?
ends

PSPROTOCOL_ASCII = 0
PSPROTOCOL_BCP = 1
PSPROTOCOL_TBCP = 2
PSPROTOCOL_BINARY = 3

QDI_SETDIBITS = 1
QDI_GETDIBITS = 2
QDI_DIBTOSCREEN = 4
QDI_STRETCHDIB = 8

SP_NOTREPORTED = 4000
SP_ERROR = -1
SP_APPABORT = -2
SP_USERABORT = -3
SP_OUTOFDISK = -4
SP_OUTOFMEMORY = -5
PR_JOBSTATUS = 0

OBJ_PEN = 1
OBJ_BRUSH = 2
OBJ_DC = 3
OBJ_METADC = 4
OBJ_PAL = 5
OBJ_FONT = 6
OBJ_BITMAP = 7
OBJ_REGION = 8
OBJ_METAFILE = 9
OBJ_MEMDC = 10
OBJ_EXTPEN = 11
OBJ_ENHMETADC = 12
OBJ_ENHMETAFILE = 13
OBJ_COLORSPACE = 14

MWT_IDENTITY = 1
MWT_LEFTMULTIPLY = 2
MWT_RIGHTMULTIPLY = 3
MWT_MIN = MWT_IDENTITY
MWT_MAX = MWT_RIGHTMULTIPLY

struct XFORM
       eM11 dd ?
       eM12 dd ?
       eM21 dd ?
       eM22 dd ?
       eDx dd ?
       eDy dd ?
ends

struct BITMAP
       bmType dd ?
       bmWidth dd ?
       bmHeight dd ?
       bmWidthBytes dd ?
       bmPlanes dw ?
       bmBitsPixel dw ?,?,?
       bmBits dq ?
ends

struct RGBTRIPLE
       rgbtBlue db ?
       rgbtGreen db ?
       rgbtRed db ?
ends

struct RGBQUAD
       rgbBlue db ?
       rgbGreen db ?
       rgbRed db ?
       rgbReserved db ?
ends

CS_ENABLE = 1
CS_DISABLE = 2
CS_DELETE_TRANSFORM = 3

LCS_SIGNATURE equ 'PSOC'
LCS_sRGB equ 'sRGB'
LCS_WINDOWS_COLOR_SPACE equ 'Win '
LCS_CALIBRATED_RGB = 0
LCS_GM_BUSINESS = 1
LCS_GM_GRAPHICS = 2
LCS_GM_IMAGES = 4
LCS_GM_ABS_COLORIMETRIC = 8
CM_OUT_OF_GAMUT = 255
CM_IN_GAMUT = 0
ICM_ADDPROFILE = 1
ICM_DELETEPROFILE = 2
ICM_QUERYPROFILE = 3
ICM_SETDEFAULTPROFILE = 4
ICM_REGISTERICMATCHER = 5
ICM_UNREGISTERICMATCHER = 6
ICM_QUERYMATCH = 7

struct CIEXYZ
       ciexyzX dd ?
       ciexyzY dd ?
       ciexyzZ dd ?
ends

struct CIEXYZTRIPLE
       ciexyzRed CIEXYZ
       ciexyzGreen CIEXYZ
       ciexyzBlue CIEXYZ
ends

struct LOGCOLORSPACEA
       lcsSignature dd ?
       lcsVersion dd ?
       lcsSize dd ?
       lcsCSType dd ?
       lcsIntent dd ?
       lcsEndpoints CIEXYZTRIPLE
       lcsGammaRed dd ?
       lcsGammaGreen dd ?
       lcsGammaBlue dd ?
       lcsFilename db MAX_PATH dup(?)
ends

struct LOGCOLORSPACEW
       lcsSignature dd ?
       lcsVersion dd ?
       lcsSize dd ?
       lcsCSType dd ?
       lcsIntent dd ?
       lcsEndpoints CIEXYZTRIPLE
       lcsGammaRed dd ?
       lcsGammaGreen dd ?
       lcsGammaBlue dd ?
       lcsFilename dw MAX_PATH dup(?)
ends

struct BITMAPCOREHEADER
       bcSize dd ?
       bcWidth dw ?
       bcHeight dw ?
       bcPlanes dw ?
       bcBitCount dw ?
ends

struct BITMAPINFOHEADER
       biSize dd ?
       biWidth dd ?
       biHeight dd ?
       biPlanes dw ?
       biBitCount dw ?
       biCompression dd ?
       biSizeImage dd ?
       biXPelsPerMeter dd ?
       biYPelsPerMeter dd ?
       biClrUsed dd ?
       biClrImportant dd ?
ends

struct BITMAPV4HEADER
       bV4Size dd ?
       bV4Width dd ?
       bV4Height dd ?
       bV4Planes dw ?
       bV4BitCount dw ?
       bV4V4Compression dd ?
       bV4SizeImage dd ?
       bV4XPelsPerMeter dd ?
       bV4YPelsPerMeter dd ?
       bV4ClrUsed dd ?
       bV4ClrImportant dd ?
       bV4RedMask dd ?
       bV4GreenMask dd ?
       bV4BlueMask dd ?
       bV4AlphaMask dd ?
       bV4CSType dd ?
       bV4Endpoints CIEXYZTRIPLE
       bV4GammaRed dd ?
       bV4GammaGreen dd ?
       bV4GammaBlue dd ?
ends

struct BITMAPV5HEADER
       bV5Size dd ?
       bV5Width dd ?
       bV5Height dd ?
       bV5Planes dw ?
       bV5BitCount dw ?
       bV5Compression dd ?
       bV5SizeImage dd ?
       bV5XPelsPerMeter dd ?
       bV5YPelsPerMeter dd ?
       bV5ClrUsed dd ?
       bV5ClrImportant dd ?
       bV5RedMask dd ?
       bV5GreenMask dd ?
       bV5BlueMask dd ?
       bV5AlphaMask dd ?
       bV5CSType dd ?
       bV5Endpoints CIEXYZTRIPLE
       bV5GammaRed dd ?
       bV5GammaGreen dd ?
       bV5GammaBlue dd ?
       bV5Intent dd ?
       bV5ProfileData dd ?
       bV5ProfileSize dd ?
       bV5Reserved dd ?
ends

PROFILE_LINKED equ 'LINK'
PROFILE_EMBEDDED equ 'MBED'
BI_RGB = 0
BI_RLE8 = 1
BI_RLE4 = 2
BI_BITFIELDS = 3
BI_JPEG = 4
BI_PNG = 5

struct BITMAPINFO
       bmiHeader BITMAPINFOHEADER
       bmiColors RGBQUAD
ends

struct BITMAPCOREINFO
       bmciHeader BITMAPCOREHEADER
       bmciColors RGBTRIPLE
       pad1 db ?
ends

struct BITMAPFILEHEADER
       bfType dw ?
       bfSize dd ?
       bfReserved1 dw ?
       bfReserved2 dw ?
       bfOffBits dd ?
ends

struct FONTSIGNATURE
       fsUsb dd ?,?,?,?
       fsCsb dd ?,?
ends

struct CHARSETINFO
       ciCharset dd ?
       ciACP dd ?
       fs FONTSIGNATURE
ends

TCI_SRCCHARSET = 1
TCI_SRCCODEPAGE = 2
TCI_SRCFONTSIG = 3
TCI_SRCLOCALE = $1000

struct LOCALESIGNATURE
       lsUsb dd 4 dup(?)
       lsCsbDefault dd 2 dup(?)
       lsCsbSupported dd 2 dup(?)
ends

struct HANDLETABLE
       objectHandle dq ?
ends

struct METARECORD
       rdSize dd ?
       rdFunction dw ?
       rdParm dw ?,?
ends

struct METAHEADER
       mtType dw ?
       mtHeaderSize dw ?
       mtVersion dw ?
       mtSize dd ?
       mtNoObjects dw ?
       mtMaxRecord dd ?
       mtNoParameters dw ?
ends

struct ENHMETARECORD
       iType dd ?
       nSize dd ?
       dParm dd ?,?
ends

struct ENHMETAHEADER
       iType dd ?
       nSize dd ?
       rclBounds RECTL
       rclFrame RECTL
       dSignature dd ?
       nVersion dd ?
       nBytes dd ?
       nRecords dd ?
       nHandles dw ?
       sReserved dw ?
       nDescription dd ?
       offDescription dd ?
       nPalEntries dd ?
       szlDevice SIZEL
       szlMillimeters SIZEL
       cbPixelFormat dd ?
       offPixelFormat dd ?
       bOpenGL dd ?
       szlMicrometers SIZEL
ends

TMPF_FIXED_PITCH = 1
TMPF_VECTOR = 2
TMPF_DEVICE = 8
TMPF_TRUETYPE = 4

struct TEXTMETRICA
       tmHeight dd ?
       tmAscent dd ?
       tmDescent dd ?
       tmInternalLeading dd ?
       tmExternalLeading dd ?
       tmAveCharWidth dd ?
       tmMaxCharWidth dd ?
       tmWeight dd ?
       tmOverhang dd ?
       tmDigitizedAspectX dd ?
       tmDigitizedAspectY dd ?
       tmFirstChar db ?
       tmLastChar db ?
       tmDefaultChar db ?
       tmBreakChar db ?
       tmItalic db ?
       tmUnderlined db ?
       tmStruckOut db ?
       tmPitchAndFamily db ?
       tmCharSet db ?,?,?,?
ends

struct TEXTMETRICW
       tmHeight dd ?
       tmAscent dd ?
       tmDescent dd ?
       tmInternalLeading dd ?
       tmExternalLeading dd ?
       tmAveCharWidth dd ?
       tmMaxCharWidth dd ?
       tmWeight dd ?
       tmOverhang dd ?
       tmDigitizedAspectX dd ?
       tmDigitizedAspectY dd ?
       tmFirstChar db ?
       tmLastChar db ?
       tmDefaultChar db ?
       tmBreakChar db ?
       tmItalic db ?
       tmUnderlined db ?
       tmStruckOut db ?
       tmPitchAndFamily db ?
       tmCharSet db ?,?,?,?
ends

NTM_REGULAR = $40
NTM_BOLD = $20
NTM_ITALIC = 1
NTM_NONNEGATIVE_AC = $10000
NTM_PS_OPENTYPE = $20000
NTM_TT_OPENTYPE = $40000
NTM_MULTIPLEMASTER = $80000
NTM_TYPE1 = $100000
NTM_DSIG = $200000

struct NEWTEXTMETRICA
       tmHeight dd ?
       tmAscent dd ?
       tmDescent dd ?
       tmInternalLeading dd ?
       tmExternalLeading dd ?
       tmAveCharWidth dd ?
       tmMaxCharWidth dd ?
       tmWeight dd ?
       tmOverhang dd ?
       tmDigitizedAspectX dd ?
       tmDigitizedAspectY dd ?
       tmFirstChar db ?
       tmLastChar db ?
       tmDefaultChar db ?
       tmBreakChar db ?
       tmItalic db ?
       tmUnderlined db ?
       tmStruckOut db ?
       tmPitchAndFamily db ?
       tmCharSet db ?
       ntmFlags dd ?
       ntmSizeEM dd ?
       ntmCellHeight dd ?
       ntmAvgWidth dd ?
       pad1 db ?,?,?
ends

struct NEWTEXTMETRICW
       tmHeight dd ?
       tmAscent dd ?
       tmDescent dd ?
       tmInternalLeading dd ?
       tmExternalLeading dd ?
       tmAveCharWidth dd ?
       tmMaxCharWidth dd ?
       tmWeight dd ?
       tmOverhang dd ?
       tmDigitizedAspectX dd ?
       tmDigitizedAspectY dd ?
       tmFirstChar du ?
       tmLastChar du ?
       tmDefaultChar du ?
       tmBreakChar du ?
       tmItalic db ?
       tmUnderlined db ?
       tmStruckOut db ?
       tmPitchAndFamily db ?
       tmCharSet db ?
       ntmFlags dd ?
       ntmSizeEM dd ?
       ntmCellHeight dd ?
       ntmAvgWidth dd ?
       pad1 db ?,?,?
ends

struct NEWTEXTMETRICEXA
       ntmTm NEWTEXTMETRICA
       ntmFontSig FONTSIGNATURE
ends

struct NEWTEXTMETRICEXW
       ntmTm NEWTEXTMETRICW
       ntmFontSig FONTSIGNATURE
ends

struct PELARRAY
       paXCount dd ?
       paYCount dd ?
       paXExt dd ?
       paYExt dd ?
       paRGBs db ?,?,?,?
ends

struct LOGBRUSH
       lbStyle dd ?
       lbColor dd ?
       lbHatch dq ?
ends

struct LOGBRUSH32
       lbStyle dd ?
       lbColor dd ?
       lbHatch dd ?
ends

struct LOGPEN
       lopnStyle dd ?
       lopnWidth POINT
       lopnColor dd ?
ends

struct EXTLOGPEN
       elpPenStyle dd ?
       elpWidth dd ?
       elpBrushStyle dd ?
       elpColor dd ?
       elpHatch dq ?
       elpNumEntries dd ?
       elpStyleEntry dd ?
ends

LF_FACESIZE = 32

struct LOGFONTA
       lfHeight dd ?
       lfWidth dd ?
       lfEscapement dd ?
       lfOrientation dd ?
       lfWeight dd ?
       lfItalic db ?
       lfUnderline db ?
       lfStrikeOut db ?
       lfCharSet db ?
       lfOutPrecision db ?
       lfClipPrecision db ?
       lfQuality db ?
       lfPitchAndFamily db ?
       lfFaceName db LF_FACESIZE dup(?)
ends

struct LOGFONTW
       lfHeight dd ?
       lfWidth dd ?
       lfEscapement dd ?
       lfOrientation dd ?
       lfWeight dd ?
       lfItalic db ?
       lfUnderline db ?
       lfStrikeOut db ?
       lfCharSet db ?
       lfOutPrecision db ?
       lfClipPrecision db ?
       lfQuality db ?
       lfPitchAndFamily db ?
       lfFaceName du LF_FACESIZE dup(?)
ends

LF_FULLFACESIZE = 64

struct ENUMLOGFONTA
       elfLogFont LOGFONTA
       elfFullName db LF_FULLFACESIZE dup(?)
       elfStyle db LF_FACESIZE dup(?)
ends

struct ENUMLOGFONTW
       elfLogFont LOGFONTW
       elfFullName dw LF_FULLFACESIZE dup(?)
       elfStyle dw LF_FACESIZE dup(?)
ends

struct ENUMLOGFONTEXA
       elfLogFont LOGFONTA
       elfFullName db LF_FULLFACESIZE dup(?)
       elfStyle db LF_FACESIZE dup(?)
       elfScript db LF_FACESIZE dup(?)
ends

struct ENUMLOGFONTEXW
       elfLogFont LOGFONTW
       elfFullName dw LF_FULLFACESIZE dup(?)
       elfStyle dw LF_FACESIZE dup(?)
       elfScript dw LF_FACESIZE dup(?)
ends

OUT_DEFAULT_PRECIS = 0
OUT_STRING_PRECIS = 1
OUT_CHARACTER_PRECIS = 2
OUT_STROKE_PRECIS = 3
OUT_TT_PRECIS = 4
OUT_DEVICE_PRECIS = 5
OUT_RASTER_PRECIS = 6
OUT_TT_ONLY_PRECIS = 7
OUT_OUTLINE_PRECIS = 8
OUT_SCREEN_OUTLINE_PRECIS = 9
OUT_PS_ONLY_PRECIS = 10

CLIP_DEFAULT_PRECIS = 0
CLIP_CHARACTER_PRECIS = 1
CLIP_STROKE_PRECIS = 2
CLIP_MASK = $f
CLIP_LH_ANGLES = (1 shl 4)
CLIP_TT_ALWAYS = (2 shl 4)
CLIP_DFA_DISABLE = (4 shl 4)
CLIP_EMBEDDED = (8 shl 4)

DEFAULT_QUALITY = 0
DRAFT_QUALITY = 1
PROOF_QUALITY = 2
NONANTIALIASED_QUALITY	= 3
ANTIALIASED_QUALITY = 4
CLEARTYPE_QUALITY = 5
CLEARTYPE_NATURAL_QUALITY = 6
DEFAULT_PITCH = 0
FIXED_PITCH = 1
VARIABLE_PITCH = 2
MONO_FONT = 8
ANSI_CHARSET = 0
DEFAULT_CHARSET = 1
SYMBOL_CHARSET = 2
SHIFTJIS_CHARSET = 128
HANGEUL_CHARSET = 129
HANGUL_CHARSET = 129
GB2312_CHARSET = 134
CHINESEBIG5_CHARSET = 136
OEM_CHARSET = 255
JOHAB_CHARSET = 130
HEBREW_CHARSET = 177
ARABIC_CHARSET = 178
GREEK_CHARSET = 161
TURKISH_CHARSET = 162
VIETNAMESE_CHARSET = 163
THAI_CHARSET = 222
EASTEUROPE_CHARSET = 238
RUSSIAN_CHARSET = 204
MAC_CHARSET = 77
BALTIC_CHARSET = 186

FS_LATIN1 = 1
FS_LATIN2 = 2
FS_CYRILLIC = 4
FS_GREEK = 8
FS_TURKISH = $10
FS_HEBREW = $20
FS_ARABIC = $40
FS_BALTIC = $80
FS_VIETNAMESE  = $100
FS_THAI = $10000
FS_JISJAPAN = $20000
FS_CHINESESIMP = $40000
FS_WANSUNG = $80000
FS_CHINESETRAD = $100000
FS_JOHAB = $200000
FS_SYMBOL = $80000000

FF_DONTCARE = (0 shl 4)
FF_ROMAN = (1 shl 4)
FF_SWISS = (2 shl 4)
FF_MODERN = (3 shl 4)
FF_SCRIPT = (4 shl 4)
FF_DECORATIVE = (5 shl 4)

FW_DONTCARE = 0
FW_THIN = 100
FW_EXTRALIGHT = 200
FW_LIGHT = 300
FW_NORMAL = 400
FW_MEDIUM = 500
FW_SEMIBOLD = 600
FW_BOLD = 700
FW_EXTRABOLD = 800
FW_HEAVY = 900

FW_ULTRALIGHT = FW_EXTRALIGHT
FW_REGULAR = FW_NORMAL
FW_DEMIBOLD = FW_SEMIBOLD
FW_ULTRABOLD  = FW_EXTRABOLD
FW_BLACK = FW_HEAVY

PANOSE_COUNT = 10
PAN_FAMILYTYPE_INDEX = 0
PAN_SERIFSTYLE_INDEX = 1
PAN_WEIGHT_INDEX = 2
PAN_PROPORTION_INDEX = 3
PAN_CONTRAST_INDEX = 4
PAN_STROKEVARIATION_INDEX = 5
PAN_ARMSTYLE_INDEX = 6
PAN_LETTERFORM_INDEX = 7
PAN_MIDLINE_INDEX = 8
PAN_XHEIGHT_INDEX = 9
PAN_CULTURE_LATIN = 0

struct PANOSE
       bFamilyType db ?
       bSerifStyle db ?
       bWeight db ?
       bProportion db ?
       bContrast db ?
       bStrokeVariation db ?
       bArmStyle db ?
       bLetterform db ?
       bMidline db ?
       bXHeight db ?
ends

PAN_ANY = 0
PAN_NO_FIT = 1
PAN_FAMILY_TEXT_DISPLAY = 2
PAN_FAMILY_SCRIPT = 3
PAN_FAMILY_DECORATIVE = 4
PAN_FAMILY_PICTORIAL = 5
PAN_SERIF_COVE = 2
PAN_SERIF_OBTUSE_COVE = 3
PAN_SERIF_SQUARE_COVE = 4
PAN_SERIF_OBTUSE_SQUARE_COVE = 5
PAN_SERIF_SQUARE = 6
PAN_SERIF_THIN = 7
PAN_SERIF_BONE = 8
PAN_SERIF_EXAGGERATED = 9
PAN_SERIF_TRIANGLE = 10
PAN_SERIF_NORMAL_SANS = 11
PAN_SERIF_OBTUSE_SANS = 12
PAN_SERIF_PERP_SANS = 13
PAN_SERIF_FLARED = 14
PAN_SERIF_ROUNDED = 15
PAN_WEIGHT_VERY_LIGHT  = 2
PAN_WEIGHT_LIGHT = 3
PAN_WEIGHT_THIN = 4
PAN_WEIGHT_BOOK = 5
PAN_WEIGHT_MEDIUM = 6
PAN_WEIGHT_DEMI = 7
PAN_WEIGHT_BOLD = 8
PAN_WEIGHT_HEAVY = 9
PAN_WEIGHT_BLACK = 10
PAN_WEIGHT_NORD = 11
PAN_PROP_OLD_STYLE = 2
PAN_PROP_MODERN = 3
PAN_PROP_EVEN_WIDTH = 4
PAN_PROP_EXPANDED = 5
PAN_PROP_CONDENSED = 6
PAN_PROP_VERY_EXPANDED = 7
PAN_PROP_VERY_CONDENSED = 8
PAN_PROP_MONOSPACED = 9
PAN_CONTRAST_NONE = 2
PAN_CONTRAST_VERY_LOW = 3
PAN_CONTRAST_LOW = 4
PAN_CONTRAST_MEDIUM_LOW = 5
PAN_CONTRAST_MEDIUM = 6
PAN_CONTRAST_MEDIUM_HIGH = 7
PAN_CONTRAST_HIGH = 8
PAN_CONTRAST_VERY_HIGH = 9
PAN_STROKE_GRADUAL_DIAG = 2
PAN_STROKE_GRADUAL_TRAN = 3
PAN_STROKE_GRADUAL_VERT = 4
PAN_STROKE_GRADUAL_HORZ = 5
PAN_STROKE_RAPID_VERT = 6
PAN_STROKE_RAPID_HORZ = 7
PAN_STROKE_INSTANT_VERT = 8
PAN_STRAIGHT_ARMS_HORZ = 2
PAN_STRAIGHT_ARMS_WEDGE = 3
PAN_STRAIGHT_ARMS_VERT = 4
PAN_STRAIGHT_ARMS_SINGLE_SERIF = 5
PAN_STRAIGHT_ARMS_DOUBLE_SERIF = 6
PAN_BENT_ARMS_HORZ = 7
PAN_BENT_ARMS_WEDGE = 8
PAN_BENT_ARMS_VERT = 9
PAN_BENT_ARMS_SINGLE_SERIF = 10
PAN_BENT_ARMS_DOUBLE_SERIF = 11
PAN_LETT_NORMAL_CONTACT = 2
PAN_LETT_NORMAL_WEIGHTED = 3
PAN_LETT_NORMAL_BOXED = 4
PAN_LETT_NORMAL_FLATTENED = 5
PAN_LETT_NORMAL_ROUNDED = 6
PAN_LETT_NORMAL_OFF_CENTER = 7
PAN_LETT_NORMAL_SQUARE = 8
PAN_LETT_OBLIQUE_CONTACT = 9
PAN_LETT_OBLIQUE_WEIGHTED = 10
PAN_LETT_OBLIQUE_BOXED = 11
PAN_LETT_OBLIQUE_FLATTENED = 12
PAN_LETT_OBLIQUE_ROUNDED = 13
PAN_LETT_OBLIQUE_OFF_CENTER = 14
PAN_LETT_OBLIQUE_SQUARE = 15
PAN_MIDLINE_STANDARD_TRIMMED = 2
PAN_MIDLINE_STANDARD_POINTED = 3
PAN_MIDLINE_STANDARD_SERIFED = 4
PAN_MIDLINE_HIGH_TRIMMED = 5
PAN_MIDLINE_HIGH_POINTED = 6
PAN_MIDLINE_HIGH_SERIFED = 7
PAN_MIDLINE_CONSTANT_TRIMMED = 8
PAN_MIDLINE_CONSTANT_POINTED = 9
PAN_MIDLINE_CONSTANT_SERIFED = 10
PAN_MIDLINE_LOW_TRIMMED = 11
PAN_MIDLINE_LOW_POINTED = 12
PAN_MIDLINE_LOW_SERIFED = 13
PAN_XHEIGHT_CONSTANT_SMALL = 2
PAN_XHEIGHT_CONSTANT_STD = 3
PAN_XHEIGHT_CONSTANT_LARGE = 4
PAN_XHEIGHT_DUCKING_SMALL = 5
PAN_XHEIGHT_DUCKING_STD = 6
PAN_XHEIGHT_DUCKING_LARGE = 7

ELF_VENDOR_SIZE = 4

struct EXTLOGFONTA
       elfLogFont LOGFONTA
       elfFullName db LF_FULLFACESIZE dup(?)
       elfStyle db LF_FACESIZE dup(?)
       elfVersion dd ?
       elfStyleSize dd ?
       elfMatch dd ?
       elfReserved dd ?
       elfVendorId db ELF_VENDOR_SIZE dup(?)
       elfCulture dd ?
       elfPanose PANOSE
       pad1 dw ?
ends

struct EXTLOGFONTW
       elfLogFont LOGFONTW
       elfFullName du LF_FULLFACESIZE dup(?)
       elfStyle du LF_FACESIZE dup(?)
       elfVersion dd ?
       elfStyleSize dd ?
       elfMatch dd ?
       elfReserved dd ?
       elfVendorId db ELF_VENDOR_SIZE dup(?)
       elfCulture dd ?
       elfPanose PANOSE
       pad1 dw ?
ends

ELF_VERSION = 0
ELF_CULTURE_LATIN = 0
RASTER_FONTTYPE = 1
DEVICE_FONTTYPE = 2
TRUETYPE_FONTTYPE = 4

;RGB(r,g,b)          ((COLORREF)(((BYTE)(r)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(b))<<16)))
;PALETTERGB(r,g,b)   (0x02000000 | RGB(r,g,b))
;PALETTEINDEX(i)     ((COLORREF)(0x01000000 | (DWORD)(WORD)(i)))

PC_RESERVED = 1
PC_EXPLICIT = 2
PC_NOCOLLAPSE = 4

;GetRValue(rgb)      (LOBYTE(rgb))
;GetGValue(rgb)      (LOBYTE(((WORD)(rgb)) >> 8))
;GetBValue(rgb)      (LOBYTE((rgb)>>16))

TRANSPARENT = 1
OPAQUE = 2
BKMODE_LAST = 2

GM_COMPATIBLE = 1
GM_ADVANCED = 2
GM_LAST = 2

PT_CLOSEFIGURE = 1
PT_LINETO = 2
PT_BEZIERTO = 4
PT_MOVETO = 6

MM_TEXT = 1
MM_LOMETRIC = 2
MM_HIMETRIC = 3
MM_LOENGLISH = 4
MM_HIENGLISH = 5
MM_TWIPS = 6
MM_ISOTROPIC = 7
MM_ANISOTROPIC = 8
MM_MIN = MM_TEXT
MM_MAX = MM_ANISOTROPIC
MM_MAX_FIXEDSCALE = MM_TWIPS

ABSOLUTE = 1
RELATIVE = 2

WHITE_BRUSH = 0
LTGRAY_BRUSH = 1
GRAY_BRUSH = 2
DKGRAY_BRUSH = 3
BLACK_BRUSH = 4
NULL_BRUSH = 5
HOLLOW_BRUSH = NULL_BRUSH
WHITE_PEN = 6
BLACK_PEN = 7
NULL_PEN = 8
OEM_FIXED_FONT = 10
ANSI_FIXED_FONT = 11
ANSI_VAR_FONT = 12
SYSTEM_FONT = 13
DEVICE_DEFAULT_FONT = 14
DEFAULT_PALETTE = 15
SYSTEM_FIXED_FONT = 16
DEFAULT_GUI_FONT = 17
DC_BRUSH = 18
DC_PEN = 19
STOCK_LAST = 19
STOCK_LAST = 17
STOCK_LAST = 16
CLR_INVALID = $FFFFFFFF

BS_SOLID = 0
BS_NULL = 1
BS_HOLLOW = BS_NULL
BS_HATCHED = 2
BS_PATTERN = 3
BS_INDEXED = 4
BS_DIBPATTERN = 5
BS_DIBPATTERNPT = 6
BS_PATTERN8X8 = 7
BS_DIBPATTERN8X8 = 8
BS_MONOPATTERN = 9

HS_HORIZONTAL = 0
HS_VERTICAL = 1
HS_FDIAGONAL = 2
HS_BDIAGONAL = 3
HS_CROSS = 4
HS_DIAGCROSS = 5

PS_SOLID = 0
PS_DASH = 1
PS_DOT = 2
PS_DASHDOT = 3
PS_DASHDOTDOT  = 4
PS_NULL = 5
PS_INSIDEFRAME = 6
PS_USERSTYLE = 7
PS_ALTERNATE = 8
PS_STYLE_MASK = $F
PS_ENDCAP_ROUND = 0
PS_ENDCAP_SQUARE = $100
PS_ENDCAP_FLAT = $200
PS_ENDCAP_MASK = $F00
PS_JOIN_ROUND = 0
PS_JOIN_BEVEL = $1000
PS_JOIN_MITER = $2000
PS_JOIN_MASK = $F000
PS_COSMETIC = 0
PS_GEOMETRIC = $10000
PS_TYPE_MASK = $F0000

AD_COUNTERCLOCKWISE = 1
AD_CLOCKWISE = 2

DRIVERVERSION = 0
TECHNOLOGY = 2
HORZSIZE = 4
VERTSIZE = 6
HORZRES = 8
VERTRES = 10
BITSPIXEL = 12
PLANES = 14
NUMBRUSHES = 16
NUMPENS = 18
NUMMARKERS = 20
NUMFONTS = 22
NUMCOLORS = 24
PDEVICESIZE = 26
CURVECAPS = 28
LINECAPS = 30
POLYGONALCAPS = 32
TEXTCAPS = 34
CLIPCAPS = 36
RASTERCAPS = 38
ASPECTX = 40
ASPECTY = 42
ASPECTXY = 44
LOGPIXELSX = 88
LOGPIXELSY = 90
SIZEPALETTE = 104
NUMRESERVED = 106
COLORRES = 108
PHYSICALWIDTH = 110
PHYSICALHEIGHT = 111
PHYSICALOFFSETX = 112
PHYSICALOFFSETY = 113
SCALINGFACTORX = 114
SCALINGFACTORY = 115
VREFRESH = 116
DESKTOPVERTRES = 117
DESKTOPHORZRES = 118
BLTALIGNMENT = 119
SHADEBLENDCAPS = 120
COLORMGMTCAPS = 121

DT_PLOTTER = 0
DT_RASDISPLAY = 1
DT_RASPRINTER = 2
DT_RASCAMERA = 3
DT_CHARSTREAM = 4
DT_METAFILE = 5
DT_DISPFILE = 6

CC_NONE = 0
CC_CIRCLES = 1
CC_PIE = 2
CC_CHORD = 4
CC_ELLIPSES = 8
CC_WIDE = 16
CC_STYLED = 32
CC_WIDESTYLED = 64
CC_INTERIORS = 128
CC_ROUNDRECT = 256

LC_NONE = 0
LC_POLYLINE = 2
LC_MARKER = 4
LC_POLYMARKER = 8
LC_WIDE = 16
LC_STYLED = 32
LC_WIDESTYLED = 64
LC_INTERIORS = 128

PC_NONE = 0
PC_POLYGON = 1
PC_RECTANGLE = 2
PC_WINDPOLYGON = 4
PC_TRAPEZOID = 4
PC_SCANLINE = 8
PC_WIDE = 16
PC_STYLED = 32
PC_WIDESTYLED = 64
PC_INTERIORS = 128
PC_POLYPOLYGON = 256
PC_PATHS = 512

CP_NONE = 0
CP_RECTANGLE = 1
CP_REGION = 2

TC_OP_CHARACTER = 1
TC_OP_STROKE = 2
TC_CP_STROKE = 4
TC_CR_90 = 8
TC_CR_ANY = $10
TC_SF_X_YINDEP = $20
TC_SA_DOUBLE = $40
TC_SA_INTEGER = $80
TC_SA_CONTIN = $100
TC_EA_DOUBLE = $200
TC_IA_ABLE = $400
TC_UA_ABLE = $800
TC_SO_ABLE = $1000
TC_RA_ABLE = $2000
TC_VA_ABLE = $4000
TC_RESERVED = $8000
TC_SCROLLBLT = $10000

RC_NONE = 0
RC_BITBLT = 1
RC_BANDING = 2
RC_SCALING = 4
RC_BITMAP64 = 8
RC_GDI20_OUTPUT = $10
RC_GDI20_STATE = $20
RC_SAVEBITMAP = $40
RC_DI_BITMAP = $80
RC_PALETTE = $100
RC_DIBTODEV = $200
RC_BIGFONT = $400
RC_STRETCHBLT = $800
RC_FLOODFILL = $1000
RC_STRETCHDIB = $2000
RC_OP_DX_OUTPUT = $4000
RC_DEVBITS = $8000

SB_NONE = 0
SB_CONST_ALPHA = 1
SB_PIXEL_ALPHA = 2
SB_PREMULT_ALPHA = 4
SB_GRAD_RECT = $10
SB_GRAD_TRI = $20

CM_NONE = 0
CM_DEVICE_ICM = 1
CM_GAMMA_RAMP = 2
CM_CMYK_COLOR = 4

DIB_RGB_COLORS = 0
DIB_PAL_COLORS = 1

SYSPAL_ERROR = 0
SYSPAL_STATIC = 1
SYSPAL_NOSTATIC = 2
SYSPAL_NOSTATIC256 = 3
CBM_INIT = 4
FLOODFILLBORDER = 0
FLOODFILLSURFACE = 1
CCHDEVICENAME = 32
CCHFORMNAME = 32

struct DEVMODEA
       dmDeviceName db CCHDEVICENAME dup(?)
       dmSpecVersion dw ?
       dmDriverVersion dw ?
       dmSize dw ?
       dmDriverExtra dw ?
       dmFields dd ?
       union
	   struct
	       dmOrientation dw ?
	       dmPaperSize dw ?
	       dmPaperLength dw ?
	       dmPaperWidth dw ?
	       dmScale dw ?
	       dmCopies dw ?
	       dmDefaultSource dw ?
	       dmPrintQuality dw ?
	   ends
	   struct
	       dmPosition POINTL
	       dmDisplayOrientation dd ?
	       dmDisplayFixedOutput dd ?
	   ends
       ends
       dmColor dw ?
       dmDuplex dw ?
       dmYResolution dw ?
       dmTTOption dw ?
       dmCollate dw ?
       dmFormName db CCHFORMNAME dup(?)
       dmLogPixels dw ?
       dmBitsPerPel dd ?
       dmPelsWidth dd ?
       dmPelsHeight dd ?
       union
	   dmDisplayFlags dd ?
	   dmNup dd ?
       ends
       dmDisplayFrequency dd ?
       dmICMMethod dd ?
       dmICMIntent dd ?
       dmMediaType dd ?
       dmDitherType dd ?
       dmReserved1 dd ?
       dmReserved2 dd ?
       dmPanningWidth dd ?
       dmPanningHeight dd ?
ends

struct DEVMODEW
       dmDeviceName du CCHDEVICENAME dup(?)
       dmSpecVersion dw ?
       dmDriverVersion dw ?
       dmSize dw ?
       dmDriverExtra dw ?
       dmFields dd ?
       union
	   struct
	       dmOrientation dw ?
	       dmPaperSize dw ?
	       dmPaperLength dw ?
	       dmPaperWidth dw ?
	       dmScale dw ?
	       dmCopies dw ?
	       dmDefaultSource dw ?
	       dmPrintQuality dw ?
	   ends
	   struct
	       dmPosition POINTL
	       dmDisplayOrientation dd ?
	       dmDisplayFixedOutput dd ?
	   ends
       ends
       dmColor dw ?
       dmDuplex dw ?
       dmYResolution dw ?
       dmTTOption dw ?
       dmCollate dw ?
       dmFormName du CCHFORMNAME dup(?)
       dmLogPixels dw ?
       dmBitsPerPel dd ?
       dmPelsWidth dd ?
       dmPelsHeight dd ?
       union
	   dmDisplayFlags dd ?
	   dmNup dd ?
       ends
       dmDisplayFrequency dd ?
       dmICMMethod dd ?
       dmICMIntent dd ?
       dmMediaType dd ?
       dmDitherType dd ?
       dmReserved1 dd ?
       dmReserved2 dd ?
       dmPanningWidth dd ?
       dmPanningHeight dd ?
ends

DM_SPECVERSION = $401
DM_SPECVERSION = $400
DM_SPECVERSION = $320
DM_ORIENTATION = 1
DM_PAPERSIZE = 2
DM_PAPERLENGTH = 4
DM_PAPERWIDTH = 8
DM_SCALE = $10
DM_POSITION = $20
DM_NUP = $40
DM_DISPLAYORIENTATION	= $80
DM_COPIES = $100
DM_DEFAULTSOURCE = $200
DM_PRINTQUALITY = $400
DM_COLOR = $800
DM_DUPLEX = $1000
DM_YRESOLUTION = $2000
DM_TTOPTION = $4000
DM_COLLATE = $8000
DM_FORMNAME = $10000
DM_LOGPIXELS = $20000
DM_BITSPERPEL = $40000
DM_PELSWIDTH = $80000
DM_PELSHEIGHT = $100000
DM_DISPLAYFLAGS = $200000
DM_DISPLAYFREQUENCY = $400000
DM_ICMMETHOD = $800000
DM_ICMINTENT = $1000000
DM_MEDIATYPE = $2000000
DM_DITHERTYPE = $4000000
DM_PANNINGWIDTH = $8000000
DM_PANNINGHEIGHT = $10000000
DM_DISPLAYFIXEDOUTPUT = $20000000

DMORIENT_PORTRAIT = 1
DMORIENT_LANDSCAPE = 2

DMPAPER_FIRST = DMPAPER_LETTER
DMPAPER_LETTER = 1
DMPAPER_LETTERSMALL = 2
DMPAPER_TABLOID = 3
DMPAPER_LEDGER = 4
DMPAPER_LEGAL = 5
DMPAPER_STATEMENT = 6
DMPAPER_EXECUTIVE = 7
DMPAPER_A3 = 8
DMPAPER_A4 = 9
DMPAPER_A4SMALL = 10
DMPAPER_A5 = 11
DMPAPER_B4 = 12
DMPAPER_B5 = 13
DMPAPER_FOLIO = 14
DMPAPER_QUARTO = 15
DMPAPER_10X14 = 16
DMPAPER_11X17 = 17
DMPAPER_NOTE = 18
DMPAPER_ENV_9 = 19
DMPAPER_ENV_10 = 20
DMPAPER_ENV_11 = 21
DMPAPER_ENV_12 = 22
DMPAPER_ENV_14 = 23
DMPAPER_CSHEET = 24
DMPAPER_DSHEET = 25
DMPAPER_ESHEET = 26
DMPAPER_ENV_DL = 27
DMPAPER_ENV_C5 = 28
DMPAPER_ENV_C3 = 29
DMPAPER_ENV_C4 = 30
DMPAPER_ENV_C6 = 31
DMPAPER_ENV_C65 = 32
DMPAPER_ENV_B4 = 33
DMPAPER_ENV_B5 = 34
DMPAPER_ENV_B6 = 35
DMPAPER_ENV_ITALY = 36
DMPAPER_ENV_MONARCH = 37
DMPAPER_ENV_PERSONAL = 38
DMPAPER_FANFOLD_US = 39
DMPAPER_FANFOLD_STD_GERMAN = 40
DMPAPER_FANFOLD_LGL_GERMAN = 41
DMPAPER_ISO_B4 = 42
DMPAPER_JAPANESE_POSTCARD = 43
DMPAPER_9X11 = 44
DMPAPER_10X11 = 45
DMPAPER_15X11 = 46
DMPAPER_ENV_INVITE = 47
DMPAPER_RESERVED_48 = 48
DMPAPER_RESERVED_49 = 49
DMPAPER_LETTER_EXTRA = 50
DMPAPER_LEGAL_EXTRA = 51
DMPAPER_TABLOID_EXTRA = 52
DMPAPER_A4_EXTRA = 53
DMPAPER_LETTER_TRANSVERSE = 54
DMPAPER_A4_TRANSVERSE = 55
DMPAPER_LETTER_EXTRA_TRANSVERSE = 56
DMPAPER_A_PLUS = 57
DMPAPER_B_PLUS = 58
DMPAPER_LETTER_PLUS = 59
DMPAPER_A4_PLUS = 60
DMPAPER_A5_TRANSVERSE = 61
DMPAPER_B5_TRANSVERSE = 62
DMPAPER_A3_EXTRA = 63
DMPAPER_A5_EXTRA = 64
DMPAPER_B5_EXTRA = 65
DMPAPER_A2 = 66
DMPAPER_A3_TRANSVERSE = 67
DMPAPER_A3_EXTRA_TRANSVERSE = 68
DMPAPER_DBL_JAPANESE_POSTCARD = 69
DMPAPER_A6 = 70
DMPAPER_JENV_KAKU2 = 71
DMPAPER_JENV_KAKU3 = 72
DMPAPER_JENV_CHOU3 = 73
DMPAPER_JENV_CHOU4 = 74
DMPAPER_LETTER_ROTATED = 75
DMPAPER_A3_ROTATED = 76
DMPAPER_A4_ROTATED = 77
DMPAPER_A5_ROTATED = 78
DMPAPER_B4_JIS_ROTATED = 79
DMPAPER_B5_JIS_ROTATED = 80
DMPAPER_JAPANESE_POSTCARD_ROTATED = 81
DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED = 82
DMPAPER_A6_ROTATED = 83
DMPAPER_JENV_KAKU2_ROTATED = 84
DMPAPER_JENV_KAKU3_ROTATED = 85
DMPAPER_JENV_CHOU3_ROTATED = 86
DMPAPER_JENV_CHOU4_ROTATED = 87
DMPAPER_B6_JIS = 88
DMPAPER_B6_JIS_ROTATED = 89
DMPAPER_12X11 = 90
DMPAPER_JENV_YOU4 = 91
DMPAPER_JENV_YOU4_ROTATED = 92
DMPAPER_P16K = 93
DMPAPER_P32K = 94
DMPAPER_P32KBIG = 95
DMPAPER_PENV_1 = 96
DMPAPER_PENV_2 = 97
DMPAPER_PENV_3 = 98
DMPAPER_PENV_4 = 99
DMPAPER_PENV_5 = 100
DMPAPER_PENV_6 = 101
DMPAPER_PENV_7 = 102
DMPAPER_PENV_8 = 103
DMPAPER_PENV_9 = 104
DMPAPER_PENV_10 = 105
DMPAPER_P16K_ROTATED = 106
DMPAPER_P32K_ROTATED = 107
DMPAPER_P32KBIG_ROTATED = 108
DMPAPER_PENV_1_ROTATED = 109
DMPAPER_PENV_2_ROTATED = 110
DMPAPER_PENV_3_ROTATED = 111
DMPAPER_PENV_4_ROTATED = 112
DMPAPER_PENV_5_ROTATED = 113
DMPAPER_PENV_6_ROTATED = 114
DMPAPER_PENV_7_ROTATED = 115
DMPAPER_PENV_8_ROTATED = 116
DMPAPER_PENV_9_ROTATED = 117
DMPAPER_PENV_10_ROTATED = 118
DMPAPER_LAST = DMPAPER_PENV_10_ROTATED
DMPAPER_LAST = DMPAPER_A3_EXTRA_TRANSVERSE
DMPAPER_LAST = DMPAPER_FANFOLD_LGL_GERMAN
DMPAPER_USER = 256

DMBIN_FIRST = DMBIN_UPPER
DMBIN_UPPER = 1
DMBIN_ONLYONE = 1
DMBIN_LOWER = 2
DMBIN_MIDDLE = 3
DMBIN_MANUAL = 4
DMBIN_ENVELOPE	= 5
DMBIN_ENVMANUAL = 6
DMBIN_AUTO = 7
DMBIN_TRACTOR = 8
DMBIN_SMALLFMT = 9
DMBIN_LARGEFMT = 10
DMBIN_LARGECAPACITY = 11
DMBIN_CASSETTE = 14
DMBIN_FORMSOURCE = 15
DMBIN_LAST = DMBIN_FORMSOURCE
DMBIN_USER = 256

DMRES_DRAFT = -1
DMRES_LOW = -2
DMRES_MEDIUM = -3
DMRES_HIGH = -4

DMCOLOR_MONOCHROME = 1
DMCOLOR_COLOR = 2

DMDUP_SIMPLEX = 1
DMDUP_VERTICAL = 2
DMDUP_HORIZONTAL = 3

DMTT_BITMAP = 1
DMTT_DOWNLOAD = 2
DMTT_SUBDEV = 3
DMTT_DOWNLOAD_OUTLINE = 4

DMCOLLATE_FALSE = 0
DMCOLLATE_TRUE = 1

DMDO_DEFAULT = 0
DMDO_90 = 1
DMDO_180 = 2
DMDO_270 = 3

DMDFO_DEFAULT = 0
DMDFO_STRETCH = 1
DMDFO_CENTER = 2

DM_GRAYSCALE = 1
DM_INTERLACED = 2
DMDISPLAYFLAGS_TEXTMODE = 4

DMNUP_SYSTEM = 1
DMNUP_ONEUP = 2

DMICMMETHOD_NONE = 1
DMICMMETHOD_SYSTEM = 2
DMICMMETHOD_DRIVER = 3
DMICMMETHOD_DEVICE = 4
DMICMMETHOD_USER = 256
DMICM_SATURATE = 1
DMICM_CONTRAST = 2
DMICM_COLORIMETRIC = 3
DMICM_ABS_COLORIMETRIC = 4
DMICM_USER = 256

DMMEDIA_STANDARD = 1
DMMEDIA_TRANSPARENCY = 2
DMMEDIA_GLOSSY = 3
DMMEDIA_USER = 256

DMDITHER_NONE = 1
DMDITHER_COARSE = 2
DMDITHER_FINE = 3
DMDITHER_LINEART = 4
DMDITHER_ERRORDIFFUSION = 5
DMDITHER_RESERVED6 = 6
DMDITHER_RESERVED7 = 7
DMDITHER_RESERVED8 = 8
DMDITHER_RESERVED9 = 9
DMDITHER_GRAYSCALE = 10
DMDITHER_USER = 256

struct DISPLAYDEVICEA
       cb dd ?
       DeviceName db 32 dup(?)
       DeviceString db 128 dup(?)
       StateFlags dd ?
       DeviceID db 128 dup(?)
       DeviceKey db 128 dup(?)
ends

struct DISPLAYDEVICEW
       cb dd ?
       DeviceName du 32 dup(?)
       DeviceString du 128 dup(?)
       StateFlags dd ?
       DeviceID du 128 dup(?)
       DeviceKey du 128 dup(?)
ends

DISPLAY_DEVICE_ATTACHED_TO_DESKTOP = 1
DISPLAY_DEVICE_MULTI_DRIVER = 2
DISPLAY_DEVICE_PRIMARY_DEVICE = 4
DISPLAY_DEVICE_MIRRORING_DRIVER = 8
DISPLAY_DEVICE_VGA_COMPATIBLE = $10
DISPLAY_DEVICE_REMOVABLE = $20
DISPLAY_DEVICE_MODESPRUNED = $8000000
DISPLAY_DEVICE_REMOTE = $4000000
DISPLAY_DEVICE_DISCONNECT  = $2000000

DISPLAY_DEVICE_ACTIVE = 1
DISPLAY_DEVICE_ATTACHED = 2

RDH_RECTANGLES = 1

struct RGNDATAHEADER
       dwSize dd ?
       iType dd ?
       nCount dd ?
       nRgnSize dd ?
       rcBound RECT
ends

struct RGNDATA
       rdh RGNDATAHEADER
       Buffer db ?,?,?,?
ends

SYSRGN = 4

struct ABC
       abcA dd ?
       abcB dd ?
       abcC dd ?
ends

struct ABCFLOAT
       abcfA dd ?
       abcfB dd ?
       abcfC dd ?
ends

struct OUTLINETEXTMETRICA
       otmSize dd ?
       otmTextMetrics TEXTMETRICA
       otmFiller db ?
       otmPanoseNumber PANOSE
       pad1 db ?
       otmfsSelection dd ?
       otmfsType dd ?
       otmsCharSlopeRise dd ?
       otmsCharSlopeRun dd ?
       otmItalicAngle dd ?
       otmEMSquare dd ?
       otmAscent dd ?
       otmDescent dd ?
       otmLineGap dd ?
       otmsCapEmHeight dd ?
       otmsXHeight dd ?
       otmrcFontBox RECT
       otmMacAscent dd ?
       otmMacDescent dd ?
       otmMacLineGap dd ?
       otmusMinimumPPEM dd ?
       otmptSubscriptSize POINT
       otmptSubscriptOffset POINT
       otmptSuperscriptSize POINT
       otmptSuperscriptOffset POINT
       otmsStrikeoutSize dd ?
       otmsStrikeoutPosition dd ?
       otmsUnderscoreSize dd ?
       otmsUnderscorePosition dd ?,?
       otmpFamilyName dq ?
       otmpFaceName dq ?
       otmpStyleName dq ?
       otmpFullName dq ?
ends

struct OUTLINETEXTMETRICW
       otmSize dd ?
       otmTextMetrics TEXTMETRICW
       otmFiller db ?
       otmPanoseNumber PANOSE
       pad1 db ?
       otmfsSelection dd ?
       otmfsType dd ?
       otmsCharSlopeRise dd ?
       otmsCharSlopeRun dd ?
       otmItalicAngle dd ?
       otmEMSquare dd ?
       otmAscent dd ?
       otmDescent dd ?
       otmLineGap dd ?
       otmsCapEmHeight dd ?
       otmsXHeight dd ?
       otmrcFontBox RECT
       otmMacAscent dd ?
       otmMacDescent dd ?
       otmMacLineGap dd ?
       otmusMinimumPPEM dd ?
       otmptSubscriptSize POINT
       otmptSubscriptOffset POINT
       otmptSuperscriptSize POINT
       otmptSuperscriptOffset POINT
       otmsStrikeoutSize dd ?
       otmsStrikeoutPosition dd ?
       otmsUnderscoreSize dd ?
       otmsUnderscorePosition dd ?,?
       otmpFamilyName dq ?
       otmpFaceName dq ?
       otmpStyleName dq ?
       otmpFullName dq ?
ends

struct POLYTEXTA
       x dd ?
       y dd ?
       n dd ?,?
       lpstr dq ?
       uiFlags dd ?
       rcl RECT
       pdx dq ?
       pad1 dd ?
ends

struct POLYTEXTW
       x dd ?
       y dd ?
       n dd ?,?
       lpstr dq ?
       uiFlags dd ?
       rcl RECT
       pdx dq ?
       pad1 dd ?
ends

struct FIXED
       fract dw ?
       value dw ?
ends

struct MAT2
       eM11 FIXED
       eM12 FIXED
       eM21 FIXED
       eM22 FIXED
ends

struct GLYPHMETRICS
       gmBlackBoxX dd ?
       gmBlackBoxY dd ?
       gmptGlyphOrigin POINT
       gmCellIncX dw ?
       gmCellIncY dw ?
ends

GGO_METRICS = 0
GGO_BITMAP = 1
GGO_NATIVE = 2
GGO_BEZIER = 3
GGO_GRAY2_BITMAP = 4
GGO_GRAY4_BITMAP = 5
GGO_GRAY8_BITMAP = 6
GGO_GLYPH_INDEX = $80
GGO_UNHINTED = $100

TT_POLYGON_TYPE = 24
TT_PRIM_LINE = 1
TT_PRIM_QSPLINE = 2
TT_PRIM_CSPLINE = 3

struct POINTFX
       x FIXED
       y FIXED
ends

struct TTPOLYCURVE
       wType dw ?
       cpfx dw ?
       apfx POINTFX
ends

struct TTPOLYGONHEADER
       cb dd ?
       dwType dd ?
       pfxStart POINTFX
ends

GCP_DBCS = 1
GCP_REORDER = 2
GCP_USEKERNING = 8
GCP_GLYPHSHAPE = $10
GCP_LIGATE = $20
GCP_GLYPHINDEXING = $80
GCP_DIACRITIC = $100
GCP_KASHIDA = $400
GCP_ERROR = $8000
FLI_MASK = $103B
GCP_JUSTIFY = $10000
GCP_NODIACRITICS = $20000
FLI_GLYPHS = $40000
GCP_CLASSIN = $80000
GCP_MAXEXTENT = $100000
GCP_JUSTIFYIN = $200000
GCP_DISPLAYZWG = $400000
GCP_SYMSWAPOFF = $800000
GCP_NUMERICOVERRIDE = $1000000
GCP_NEUTRALOVERRIDE = $2000000
GCP_NUMERICSLATIN = $4000000
GCP_NUMERICSLOCAL = $8000000

GCPCLASS_LATIN = 1
GCPCLASS_HEBREW = 2
GCPCLASS_ARABIC = 2
GCPCLASS_NEUTRAL = 3
GCPCLASS_LOCALNUMBER = 4
GCPCLASS_LATINNUMBER = 5
GCPCLASS_LATINNUMERICTERMINATOR = 6
GCPCLASS_LATINNUMERICSEPARATOR = 7
GCPCLASS_NUMERICSEPARATOR = 8
GCPCLASS_PREBOUNDLTR = $80
GCPCLASS_PREBOUNDRTL = $40
GCPCLASS_POSTBOUNDLTR = $20
GCPCLASS_POSTBOUNDRTL = $10

GCPGLYPH_LINKBEFORE = $8000
GCPGLYPH_LINKAFTER = $4000

struct GCPRESULTSA
       lStructSize dd ?,?
       lpOutString dq ?
       lpOrder dq ?
       lpDx dq ?
       lpCaretPos dq ?
       lpClass dq ?
       lpGlyphs dq ?
       nGlyphs dd ?
       nMaxFit dd ?
ends

struct GCPRESULTSW
       lStructSize dd ?,?
       lpOutString dq ?
       lpOrder dq ?
       lpDx dq ?
       lpCaretPos dq ?
       lpClass dq ?
       lpGlyphs dq ?
       nGlyphs dd ?
       nMaxFit dd ?
ends

struct RASTERIZERSTATUS
       nSize dw ?
       wFlags dw ?
       nLanguageID dw ?
ends

TT_AVAILABLE = 1
TT_ENABLED = 2

struct PIXELFORMATDESCRIPTOR
       nSize dw ?
       nVersion dw ?
       dwFlags dd ?
       iPixelType db ?
       cColorBits db ?
       cRedBits db ?
       cRedShift db ?
       cGreenBits db ?
       cGreenShift db ?
       cBlueBits db ?
       cBlueShift db ?
       cAlphaBits db ?
       cAlphaShift db ?
       cAccumBits db ?
       cAccumRedBits db ?
       cAccumGreenBits db ?
       cAccumBlueBits db ?
       cAccumAlphaBits db ?
       cDepthBits db ?
       cStencilBits db ?
       cAuxBuffers db ?
       iLayerType db ?
       bReserved db ?
       dwLayerMask dd ?
       dwVisibleMask dd ?
       dwDamageMask dd ?
ends

PFD_TYPE_RGBA = 0
PFD_TYPE_COLORINDEX  = 1
PFD_MAIN_PLANE = 0
PFD_OVERLAY_PLANE = 1
PFD_UNDERLAY_PLANE = -1
PFD_DOUBLEBUFFER = 1
PFD_STEREO = 2
PFD_DRAW_TO_WINDOW = 4
PFD_DRAW_TO_BITMAP = 8
PFD_SUPPORT_GDI = $10
PFD_SUPPORT_OPENGL = $20
PFD_GENERIC_FORMAT = $40
PFD_NEED_PALETTE = $80
PFD_NEED_SYSTEM_PALETTE = $100
PFD_SWAP_EXCHANGE = $200
PFD_SWAP_COPY = $400
PFD_SWAP_LAYER_BUFFERS = $800
PFD_GENERIC_ACCELERATED = $1000
PFD_SUPPORT_DIRECTDRAW = $2000
PFD_DEPTH_DONTCARE = $20000000
PFD_DOUBLEBUFFER_DONTCARE = $40000000
PFD_STEREO_DONTCARE = $80000000

DM_UPDATE = 1
DM_COPY = 2
DM_PROMPT = 4
DM_MODIFY = 8
DM_IN_BUFFER = DM_MODIFY
DM_IN_PROMPT = DM_PROMPT
DM_OUT_BUFFER = DM_COPY
DM_OUT_DEFAULT = DM_UPDATE

DC_FIELDS = 1
DC_PAPERS = 2
DC_PAPERSIZE = 3
DC_MINEXTENT = 4
DC_MAXEXTENT = 5
DC_BINS = 6
DC_DUPLEX = 7
DC_SIZE = 8
DC_EXTRA = 9
DC_VERSION = 10
DC_DRIVER = 11
DC_BINNAMES = 12
DC_ENUMRESOLUTIONS  = 13
DC_FILEDEPENDENCIES = 14
DC_TRUETYPE = 15
DC_PAPERNAMES = 16
DC_ORIENTATION = 17
DC_COPIES = 18
DC_BINADJUST = 19
DC_EMF_COMPLIANT = 20
DC_DATATYPE_PRODUCED = 21
DC_COLLATE = 22
DC_MANUFACTURER = 23
DC_MODEL = 24
DC_PERSONALITY = 25
DC_PRINTRATE = 26
DC_PRINTRATEUNIT = 27
PRINTRATEUNIT_PPM = 1
PRINTRATEUNIT_CPS = 2
PRINTRATEUNIT_LPM = 3
PRINTRATEUNIT_IPM = 4
DC_PRINTERMEM = 28
DC_MEDIAREADY = 29
DC_STAPLE = 30
DC_PRINTRATEPPM = 31
DC_COLORDEVICE = 32
DC_NUP = 33
DC_MEDIATYPENAMES = 34
DC_MEDIATYPES = 35

DCTT_BITMAP = 1
DCTT_DOWNLOAD = 2
DCTT_SUBDEV = 4
DCTT_DOWNLOAD_OUTLINE = 8

DCBA_FACEUPNONE = 0
DCBA_FACEUPCENTER = 1
DCBA_FACEUPLEFT = 2
DCBA_FACEUPRIGHT = 3
DCBA_FACEDOWNNONE = $100
DCBA_FACEDOWNCENTER = $101
DCBA_FACEDOWNLEFT = $102
DCBA_FACEDOWNRIGHT = $103

struct WCRANGE
       wcLow dw ?
       cGlyphs dw ?
ends

struct GLYPHSET
       cbThis dd ?
       flAccel dd ?
       cGlyphsSupported dd ?
       cRanges dd ?
       ranges WCRANGE
ends

GS_8BIT_INDICES = 1
GGI_MARK_NONEXISTING_GLYPHS = 1
STAMP_DESIGNVECTOR = $80000000 + 'vd'
STAMP_AXESLIST = $80000000 + 'la'
MM_MAX_NUMAXES = 16

struct DESIGNVECTOR
       dvReserved dd ?
       dvNumAxes dd ?
       dvValues dd MM_MAX_NUMAXES dup(?)
ends

FR_PRIVATE = $10
FR_NOT_ENUM = $20
MM_MAX_AXES_NAMELEN = 16

struct AXISINFOA
       axMinValue dd ?
       axMaxValue dd ?
       axAxisName db MM_MAX_AXES_NAMELEN dup(?)
ends

struct AXISINFOW
       axMinValue dd ?
       axMaxValue dd ?
       axAxisName du MM_MAX_AXES_NAMELEN dup(?)
ends

struct AXESLISTA
       axlReserved dd ?
       axlNumAxes dd ?
       axlAxisInfo AXISINFOA
		   db sizeof.AXISINFOA * (MM_MAX_NUMAXES-1) dup(?)
ends

struct AXESLISTW
       axlReserved dd ?
       axlNumAxes dd ?
       axlAxisInfo AXISINFOW
		   db sizeof.AXISINFOW * (MM_MAX_NUMAXES - 1) dup(?)
ends

struct ENUMLOGFONTEXDVA
       elfEnumLogfontEx ENUMLOGFONTEXA
       elfDesignVector DESIGNVECTOR
ends

struct ENUMLOGFONTEXDVW
       elfEnumLogfontEx ENUMLOGFONTEXW
       elfDesignVector DESIGNVECTOR
ends

struct ENUMTEXTMETRICA
       etmNewTextMetricEx NEWTEXTMETRICEXA
       etmAxesList AXESLISTA
ends

struct ENUMTEXTMETRICW
       etmNewTextMetricEx NEWTEXTMETRICEXW
       etmAxesList AXESLISTW
ends

struct TRIVERTEX
       x dd ?
       y dd ?
       Red dw ?
       Green dw ?
       Blue dw ?
       Alpha dw ?
ends

struct GRADIENTTRIANGLE
       Vertex1 dd ?
       Vertex2 dd ?
       Vertex3 dd ?
ends

struct GRADIENTRECT
       UpperLeft dd ?
       LowerRight dd ?
ends

struct BLENDFUNCTION
       BlendOp db ?
       BlendFlags db ?
       SourceConstantAlpha db ?
       AlphaFormat db ?
ends

AC_SRC_OVER = 0
AC_SRC_ALPHA = 1

GRADIENT_FILL_RECT_H = 0
GRADIENT_FILL_RECT_V = 1
GRADIENT_FILL_TRIANGLE = 2
GRADIENT_FILL_OP_FLAG = $ff

struct DIBSECTION
       dsBm BITMAP
       dsBmih BITMAPINFOHEADER
       dsBitfields dd ?,?,?,?
       dshSection dq ?
       dsOffset dd ?,?
ends

CA_NEGATIVE = 1
CA_LOG_FILTER = 2

ILLUMINANT_DEVICE_DEFAULT = 0
ILLUMINANT_A = 1
ILLUMINANT_B = 2
ILLUMINANT_C = 3
ILLUMINANT_D50 = 4
ILLUMINANT_D55 = 5
ILLUMINANT_D65 = 6
ILLUMINANT_D75 = 7
ILLUMINANT_F2 = 8
ILLUMINANT_MAX_INDEX = ILLUMINANT_F2

ILLUMINANT_TUNGSTEN = ILLUMINANT_A
ILLUMINANT_DAYLIGHT = ILLUMINANT_C
ILLUMINANT_FLUORESCENT = ILLUMINANT_F2
ILLUMINANT_NTSC = ILLUMINANT_C

RGB_GAMMA_MIN = 2500
RGB_GAMMA_MAX = 65000

REFERENCE_WHITE_MIN = 6000
REFERENCE_WHITE_MAX = 10000
REFERENCE_BLACK_MIN = 0
REFERENCE_BLACK_MAX = 4000

COLOR_ADJ_MIN = -100
COLOR_ADJ_MAX = 100

struct COLORADJUSTMENT
       caSize dw ?
       caFlags dw ?
       caIlluminantIndex dw ?
       caRedGamma dw ?
       caGreenGamma dw ?
       caBlueGamma dw ?
       caReferenceBlack dw ?
       caReferenceWhite dw ?
       caContrast dw ?
       caBrightness dw ?
       caColorfulness dw ?
       caRedGreenTint dw ?
ends

struct DOCINFOA
       cbSize dd ?,?
       lpszDocName dq ?
       lpszOutput dq ?
       lpszDatatype dq ?
       fwType dd ?,?
ends

struct DOCINFOW
       cbSize dd ?,?
       lpszDocName dq ?
       lpszOutput dq ?
       lpszDatatype dq ?
       fwType dd ?,?
ends

DI_APPBANDING = 1
DI_ROPS_READ_DESTINATION = 2
FONTMAPPER_MAX = 10

struct KERNINGPAIR
       wFirst dw ?
       wSecond dw ?
       iKernAmount dd ?
ends

ICM_OFF = 1
ICM_ON = 2
ICM_QUERY = 3
ICM_DONE_OUTSIDEDC = 4

ENHMETA_STOCK_OBJECT = $80000000

EMR_HEADER = 1
EMR_POLYBEZIER = 2
EMR_POLYGON = 3
EMR_POLYLINE = 4
EMR_POLYBEZIERTO = 5
EMR_POLYLINETO = 6
EMR_POLYPOLYLINE = 7
EMR_POLYPOLYGON = 8
EMR_SETWINDOWEXTEX = 9
EMR_SETWINDOWORGEX = 10
EMR_SETVIEWPORTEXTEX = 11
EMR_SETVIEWPORTORGEX = 12
EMR_SETBRUSHORGEX = 13
EMR_EOF = 14
EMR_SETPIXELV = 15
EMR_SETMAPPERFLAGS  = 16
EMR_SETMAPMODE = 17
EMR_SETBKMODE = 18
EMR_SETPOLYFILLMODE = 19
EMR_SETROP2 = 20
EMR_SETSTRETCHBLTMODE = 21
EMR_SETTEXTALIGN = 22
EMR_SETCOLORADJUSTMENT = 23
EMR_SETTEXTCOLOR  = 24
EMR_SETBKCOLOR = 25
EMR_OFFSETCLIPRGN = 26
EMR_MOVETOEX = 27
EMR_SETMETARGN = 28
EMR_EXCLUDECLIPRECT = 29
EMR_INTERSECTCLIPRECT = 30
EMR_SCALEVIEWPORTEXTEX = 31
EMR_SCALEWINDOWEXTEX = 32
EMR_SAVEDC = 33
EMR_RESTOREDC = 34
EMR_SETWORLDTRANSFORM = 35
EMR_MODIFYWORLDTRANSFORM = 36
EMR_SELECTOBJECT = 37
EMR_CREATEPEN = 38
EMR_CREATEBRUSHINDIRECT = 39
EMR_DELETEOBJECT  = 40
EMR_ANGLEARC = 41
EMR_ELLIPSE = 42
EMR_RECTANGLE = 43
EMR_ROUNDRECT = 44
EMR_ARC = 45
EMR_CHORD = 46
EMR_PIE = 47
EMR_SELECTPALETTE = 48
EMR_CREATEPALETTE = 49
EMR_SETPALETTEENTRIES = 50
EMR_RESIZEPALETTE = 51
EMR_REALIZEPALETTE = 52
EMR_EXTFLOODFILL   = 53
EMR_LINETO = 54
EMR_ARCTO = 55
EMR_POLYDRAW = 56
EMR_SETARCDIRECTION = 57
EMR_SETMITERLIMIT = 58
EMR_BEGINPATH = 59
EMR_ENDPATH = 60
EMR_CLOSEFIGURE = 61
EMR_FILLPATH = 62
EMR_STROKEANDFILLPATH = 63
EMR_STROKEPATH = 64
EMR_FLATTENPATH = 65
EMR_WIDENPATH = 66
EMR_SELECTCLIPPATH = 67
EMR_ABORTPATH = 68
EMR_GDICOMMENT = 70
EMR_FILLRGN = 71
EMR_FRAMERGN = 72
EMR_INVERTRGN = 73
EMR_PAINTRGN = 74
EMR_EXTSELECTCLIPRGN = 75
EMR_BITBLT = 76
EMR_STRETCHBLT = 77
EMR_MASKBLT = 78
EMR_PLGBLT = 79
EMR_SETDIBITSTODEVICE = 80
EMR_STRETCHDIBITS = 81
EMR_EXTCREATEFONTINDIRECTW = 82
EMR_EXTTEXTOUTA = 83
EMR_EXTTEXTOUTW = 84
EMR_POLYBEZIER16 = 85
EMR_POLYGON16 = 86
EMR_POLYLINE16 = 87
EMR_POLYBEZIERTO16 = 88
EMR_POLYLINETO16 = 89
EMR_POLYPOLYLINE16 = 90
EMR_POLYPOLYGON16 = 91
EMR_POLYDRAW16 = 92
EMR_CREATEMONOBRUSH = 93
EMR_CREATEDIBPATTERNBRUSHPT = 94
EMR_EXTCREATEPEN = 95
EMR_POLYTEXTOUTA = 96
EMR_POLYTEXTOUTW = 97
EMR_SETICMMODE = 98
EMR_CREATECOLORSPACE = 99
EMR_SETCOLORSPACE = 100
EMR_DELETECOLORSPACE = 101
EMR_GLSRECORD = 102
EMR_GLSBOUNDEDRECORD = 103
EMR_PIXELFORMAT = 104
EMR_RESERVED_105 = 105
EMR_RESERVED_106 = 106
EMR_RESERVED_107 = 107
EMR_RESERVED_108 = 108
EMR_RESERVED_109 = 109
EMR_RESERVED_110 = 110
EMR_COLORCORRECTPALETTE = 111
EMR_SETICMPROFILEA = 112
EMR_SETICMPROFILEW = 113
EMR_ALPHABLEND = 114
EMR_SETLAYOUT = 115
EMR_TRANSPARENTBLT = 116
EMR_RESERVED_117 = 117
EMR_GRADIENTFILL = 118
EMR_RESERVED_119 = 119
EMR_RESERVED_120 = 120
EMR_COLORMATCHTOTARGETW = 121
EMR_CREATECOLORSPACEW = 122
EMR_MIN = 1
EMR_MAX = 122

struct EMR
       iType dd ?
       nSize dd ?
ends

struct EMRTEXT
       ptlReference POINTL
       nChars dd ?
       offString dd ?
       fOptions dd ?
       rcl RECTL
       offDx dd ?
ends

struct ABORTPATH
       emr EMR
ends

struct EMRSELECTCLIPPATH
       emr EMR
       iMode dd ?
ends

struct EMRSETMITERLIMIT
       emr EMR
       eMiterLimit dd ?
ends

struct EMRRESTOREDC
       emr EMR
       iRelative dd ?
ends

struct EMRSETARCDIRECTION
       emr EMR
       iArcDirection dd ?
ends

struct EMRSETMAPPERFLAGS
       emr EMR
       dwFlags dd ?
ends

struct EMRSETTEXTCOLOR
       emr EMR
       crColor dd ?
ends

struct EMRSELECTOBJECT
       emr  EMR
       ihObject dd ?
ends

struct EMRSELECTPALETTE
       emr  EMR
       ihPal dd ?
ends

struct EMRRESIZEPALETTE
       emr EMR
       ihPal dd ?
       cEntries dd ?
ends

struct EMRSETPALETTEENTRIES
       emr EMR
       ihPal dd ?
       iStart dd ?
       cEntries dd ?
       aPalEntries  PALETTEENTRY
ends

struct EMRSETCOLORADJUSTMENT
       emr EMR
       ColorAdjustment COLORADJUSTMENT
ends

struct EMRGDICOMMENT
       emr EMR
       cbData dd ?
       Data db ?,?
ends

struct EMREOF
       emr EMR
       nPalEntries dd ?
       offPalEntries dd ?
       nSizeLast dd ?
ends

struct EMRLINETO
       emr EMR
       ptl POINTL
ends

struct EMROFFSETCLIPRGN
       emr EMR
       ptlOffset POINTL
ends

struct EMRFILLPATH
       emr EMR
       rclBounds RECTL
ends

struct EMREXCLUDECLIPRECT
       emr EMR
       rclClip RECTL
ends

struct EMRSETVIEWPORTORGEX
       emr EMR
       ptlOrigin POINTL
ends

struct EMRSETVIEWPORTEXTEX
       emr EMR
       szlExtent SIZEL
ends

struct EMRSCALEVIEWPORTEXTEX
       emr EMR
       xNum dd ?
       xDenom dd ?
       yNum dd ?
       yDenom dd ?
ends

struct EMRSETWORLDTRANSFORM
       emr EMR
       xform XFORM
ends

struct EMRMODIFYWORLDTRANSFORM
       emr EMR
       xform XFORM
       iMode dd ?
ends

struct EMRSETPIXELV
       emr EMR
       ptlPixel POINTL
       crColor dd ?
ends

struct EMREXTFLOODFILL
       emr EMR
       ptlStart POINTL
       crColor dd ?
       iMode dd ?
ends

struct EMRELLIPSE
       emr EMR
       rclBox RECTL
ends

struct EMRROUNDRECT
       emr EMR
       rclBox RECTL
       szlCorner SIZEL
ends

struct EMRARC
       emr EMR
       rclBox RECTL
       ptlStart POINTL
       ptlEnd POINTL
ends

struct EMRANGLEARC
       emr EMR
       ptlCenter POINTL
       nRadius dd ?
       eStartAngle dd ?
       eSweepAngle dd ?
ends

struct EMRPOLYLINE
       emr EMR
       rclBounds RECTL
       cptl dd ?
       aptl POINTL
ends

struct EMRPOLYLINE16
       emr EMR
       rclBounds RECTL
       cpts dd ?
       apts POINTS
ends

struct EMRPOLYDRAW
       emr EMR
       rclBounds RECTL
       cptl dd ?
       aptl POINTL
       abTypes db ?
ends

struct EMRPOLYDRAW16
       emr EMR
       rclBounds RECTL
       cpts dd ?
       apts POINTS
       abTypes db ?
ends

struct EMRPOLYPOLYLINE
       emr EMR
       rclBounds RECTL
       nPolys dd ?
       cptl dd ?
       aPolyCounts dd ?
       aptl POINTL
ends

struct EMRPOLYPOLYLINE16
       emr EMR
       rclBounds RECTL
       nPolys dd ?
       cpts dd ?
       aPolyCounts dd ?
       apts POINTS
ends

struct EMRINVERTRGN
       emr EMR
       rclBounds RECTL
       cbRgnData dd ?
       RgnData db ?
ends

struct EMRFILLRGN
       emr EMR
       rclBounds RECTL
       cbRgnData dd ?
       ihBrush dd ?
       RgnData db ?
ends

struct EMRFRAMERGN
       emr EMR
       rclBounds RECTL
       cbRgnData dd ?
       ihBrush dd ?
       szlStroke SIZEL
       RgnData db ?
ends

struct EMREXTSELECTCLIPRGN
       emr EMR
       cbRgnData dd ?
       iMode dd ?
       RgnData db ?
ends

struct EMREXTTEXTOUTA
       emr EMR
       rclBounds RECTL
       iGraphicsMode dd ?
       exScale dd ?
       eyScale dd ?
       emrtext EMRTEXT
ends

struct EMREXTTEXTOUTW
       emr EMR
       rclBounds RECTL
       iGraphicsMode dd ?
       exScale dd ?
       eyScale dd ?
       emrtext EMRTEXT
ends

struct EMRPOLYTEXTOUTA
       emr EMR
       rclBounds RECTL
       iGraphicsMode dd ?
       exScale dd ?
       eyScale dd ?
       cStrings dd ?
       aemrtext EMRTEXT
ends

struct EMRPOLYTEXTOUTW
       emr EMR
       rclBounds RECTL
       iGraphicsMode dd ?
       exScale dd ?
       eyScale dd ?
       cStrings dd ?
       aemrtext EMRTEXT
ends

struct EMRBITBLT
       emr EMR
       rclBounds RECTL
       xDest dd ?
       yDest dd ?
       cxDest dd ?
       cyDest dd ?
       dwRop dd ?
       xSrc dd ?
       ySrc dd ?
       xformSrc XFORM
       crBkColorSrc dd ?
       iUsageSrc dd ?
       offBmiSrc dd ?
       cbBmiSrc dd ?
       offBitsSrc dd ?
       cbBitsSrc dd ?
ends

struct EMRSTRETCHBLT
       emr EMR
       rclBounds RECTL
       xDest dd ?
       yDest dd ?
       cxDest dd ?
       cyDest dd ?
       dwRop dd ?
       xSrc dd ?
       ySrc dd ?
       xformSrc XFORM
       crBkColorSrc dd ?
       iUsageSrc dd ?
       offBmiSrc dd ?
       cbBmiSrc dd ?
       offBitsSrc dd ?
       cbBitsSrc dd ?
       cxSrc dd ?
       cySrc dd ?
ends

struct EMRMASKBLT
       emr EMR
       rclBounds RECTL
       xDest dd ?
       yDest dd ?
       cxDest dd ?
       cyDest dd ?
       dwRop dd ?
       xSrc dd ?
       ySrc dd ?
       xformSrc XFORM
       crBkColorSrc dd ?
       iUsageSrc dd ?
       offBmiSrc dd ?
       cbBmiSrc dd ?
       offBitsSrc dd ?
       cbBitsSrc dd ?
       xMask dd ?
       yMask dd ?
       iUsageMask dd ?
       offBmiMask dd ?
       cbBmiMask dd ?
       offBitsMask dd ?
       cbBitsMask dd ?
ends

struct EMRPLGBLT
       emr EMR
       rclBounds RECTL
       aptlDest  POINTL
		 db sizeof.POINTL*2 dup(?)
       xSrc dd ?
       ySrc dd ?
       cxSrc dd ?
       cySrc dd ?
       xformSrc XFORM
       crBkColorSrc dd ?
       iUsageSrc dd ?
       offBmiSrc dd ?
       cbBmiSrc dd ?
       offBitsSrc dd ?
       cbBitsSrc dd ?
       xMask dd ?
       yMask dd ?
       iUsageMask dd ?
       offBmiMask dd ?
       cbBmiMask dd ?
       offBitsMask dd ?
       cbBitsMask dd ?
ends

struct EMRSETDIBITSTODEVICE
       emr EMR
       rclBounds RECTL
       xDest dd ?
       yDest dd ?
       xSrc dd ?
       ySrc dd ?
       cxSrc dd ?
       cySrc dd ?
       offBmiSrc dd ?
       cbBmiSrc dd ?
       offBitsSrc dd ?
       cbBitsSrc dd ?
       iUsageSrc dd ?
       iStartScan dd ?
       cScans dd ?
ends

struct EMRSTRETCHDIBITS
       emr EMR
       rclBounds RECTL
       xDest dd ?
       yDest dd ?
       xSrc dd ?
       ySrc dd ?
       cxSrc dd ?
       cySrc dd ?
       offBmiSrc dd ?
       cbBmiSrc dd ?
       offBitsSrc dd ?
       cbBitsSrc dd ?
       iUsageSrc dd ?
       dwRop dd ?
       cxDest dd ?
       cyDest dd ?
ends

struct EMREXTCREATEFONTINDIRECTW
       emr EMR
       ihFont dd ?
       elfw EXTLOGFONTW
ends

struct EMRCREATEPALETTE
       emr EMR
       ihPal dd ?
       lgpl LOGPALETTE
ends

struct EMRCREATEPEN
       emr EMR
       ihPen dd ?
       lopn LOGPEN
ends

struct EMREXTCREATEPEN
       emr EMR
       ihPen dd ?
       offBmi dd ?
       cbBmi dd ?
       offBits dd ?
       cbBits dd ?
       elp EXTLOGPEN
ends

struct EMRCREATEBRUSHINDIRECT
       emr EMR
       ihBrush dd ?
       lb LOGBRUSH32
ends

struct EMRCREATEMONOBRUSH
       emr EMR
       ihBrush dd ?
       iUsage dd ?
       offBmi dd ?
       cbBmi dd ?
       offBits dd ?
       cbBits dd ?
ends

struct EMRCREATEDIBPATTERNBRUSHPT
       emr EMR
       ihBrush dd ?
       iUsage dd ?
       offBmi dd ?
       cbBmi dd ?
       offBits dd ?
       cbBits dd ?
ends

struct EMRFORMAT
       dSignature dd ?
       nVersion dd ?
       cbData dd ?
       offData dd ?
ends

struct EMRGLSRECORD
       emr EMR
       cbData dd ?
       Data db ?,?,?,?
ends

struct EMRGLSBOUNDEDRECORD
       emr EMR
       rclBounds RECTL
       cbData dd ?
       Data db ?,?,?,?
ends

struct EMRPIXELFORMAT
       emr EMR
       pfd PIXELFORMATDESCRIPTOR
ends

struct EMRCREATECOLORSPACE
       emr EMR
       ihCS dd ?
       lcs LOGCOLORSPACEW
ends

struct EMRSETCOLORSPACE
       emr EMR
       ihCS dd ?
ends

struct EMREXTESCAPE
       emr EMR
       iEscape dd ?
       cbEscData dd ?
       EscData db ?,?,?,?
ends

struct EMRNAMEDESCAPE
       emr EMR
       iEscape dd ?
       cbDriver dd ?
       cbEscData dd ?
       EscData db ?,?,?,?
ends

SETICMPROFILE_EMBEDED = 1

struct EMRSETICMPROFILE
       emr EMR
       dwFlags dd ?
       cbName dd ?
       cbData dd ?
       Data db ?,?,?,?
ends

CREATECOLORSPACE_EMBEDED = 1

struct EMRCREATECOLORSPACEW
       emr EMR
       ihCS dd ?
       lcs LOGCOLORSPACEW
       dwFlags dd ?
       cbData dd ?
       Data db ?,?,?,?
ends

COLORMATCHTOTARGET_EMBEDED = 1

struct EMRCOLORMATCHTOTARGET
       emr EMR
       dwAction dd ?
       dwFlags dd ?
       cbName dd ?
       cbData dd ?
       Data db ?,?,?,?
ends

struct EMRCOLORCORRECTPALETTE
       emr EMR
       ihPalette dd ?
       nFirstEntry dd ?
       nPalEntries dd ?
       nReserved dd ?
ends

struct EMRALPHABLEND
       emr EMR
       rclBounds RECTL
       xDest dd ?
       yDest dd ?
       cxDest dd ?
       cyDest dd ?
       dwRop dd ?
       xSrc dd ?
       ySrc dd ?
       xformSrc XFORM
       crBkColorSrc dd ?
       iUsageSrc dd ?
       offBmiSrc dd ?
       cbBmiSrc dd ?
       offBitsSrc dd ?
       cbBitsSrc dd ?
       cxSrc dd ?
       cySrc dd ?
ends

struct EMRGRADIENTFILL
       emr EMR
       rclBounds RECTL
       nVer dd ?
       nTri dd ?
       ulMode dd ?
       Ver TRIVERTEX
ends

struct EMRTRANSPARENTBLT
       emr EMR
       rclBounds RECTL
       xDest dd ?
       yDest dd ?
       cxDest dd ?
       cyDest dd ?
       dwRop dd ?
       xSrc dd ?
       ySrc dd ?
       xformSrc XFORM
       crBkColorSrc dd ?
       iUsageSrc dd ?
       offBmiSrc dd ?
       cbBmiSrc dd ?
       offBitsSrc dd ?
       cbBitsSrc dd ?
       cxSrc dd ?
       cySrc dd ?
ends

GDICOMMENT_IDENTIFIER = $43494447
GDICOMMENT_WINDOWS_METAFILE = $80000001
GDICOMMENT_BEGINGROUP = 2
GDICOMMENT_ENDGROUP = 3
GDICOMMENT_MULTIFORMATS = $40000004
EPS_SIGNATURE = $46535045
GDICOMMENT_UNICODE_STRING = $40
GDICOMMENT_UNICODE_END = $80

struct POINTFLOAT
       x dd ?
       y dd ?
ends

struct GLYPHMETRICSFLOAT
       gmfBlackBoxX dd ?
       gmfBlackBoxY dd ?
       gmfptGlyphOrigin POINTFLOAT
       gmfCellIncX dd ?
       gmfCellIncY dd ?
ends

WGL_FONT_LINES = 0
WGL_FONT_POLYGONS = 1

struct LAYERPLANEDESCRIPTOR
       nSize dw ?
       nVersion dw ?
       dwFlags dd ?
       iPixelType db ?
       cColorBits db ?
       cRedBits db ?
       cRedShift db ?
       cGreenBits db ?
       cGreenShift db ?
       cBlueBits db ?
       cBlueShift db ?
       cAlphaBits db ?
       cAlphaShift db ?
       cAccumBits db ?
       cAccumRedBits db ?
       cAccumGreenBits db ?
       cAccumBlueBits db ?
       cAccumAlphaBits db ?
       cDepthBits db ?
       cStencilBits db ?
       cAuxBuffers db ?
       iLayerPlane db ?
       bReserved db ?
       crTransparent dd ?
ends

LPD_DOUBLEBUFFER = 1
LPD_STEREO = 2
LPD_SUPPORT_GDI = $10
LPD_SUPPORT_OPENGL = $20
LPD_SHARE_DEPTH = $40
LPD_SHARE_STENCIL = $80
LPD_SHARE_ACCUM = $100
LPD_SWAP_EXCHANGE = $200
LPD_SWAP_COPY = $400
LPD_TRANSPARENT = $1000
LPD_TYPE_RGBA = 0
LPD_TYPE_COLORINDEX = 1

WGL_SWAP_MAIN_PLANE = 1
WGL_SWAP_OVERLAY1 = 2
WGL_SWAP_OVERLAY2 = 4
WGL_SWAP_OVERLAY3 = 8
WGL_SWAP_OVERLAY4 = $10
WGL_SWAP_OVERLAY5 = $20
WGL_SWAP_OVERLAY6 = $40
WGL_SWAP_OVERLAY7 = $80
WGL_SWAP_OVERLAY8 = $100
WGL_SWAP_OVERLAY9 = $200
WGL_SWAP_OVERLAY10 = $400
WGL_SWAP_OVERLAY11 = $800
WGL_SWAP_OVERLAY12 = $1000
WGL_SWAP_OVERLAY13 = $2000
WGL_SWAP_OVERLAY14 = $4000
WGL_SWAP_OVERLAY15 = $8000
WGL_SWAP_UNDERLAY1 = $10000
WGL_SWAP_UNDERLAY2 = $20000
WGL_SWAP_UNDERLAY3 = $40000
WGL_SWAP_UNDERLAY4 = $80000
WGL_SWAP_UNDERLAY5 = $100000
WGL_SWAP_UNDERLAY6 = $200000
WGL_SWAP_UNDERLAY7 = $400000
WGL_SWAP_UNDERLAY8 = $800000
WGL_SWAP_UNDERLAY9 = $1000000
WGL_SWAP_UNDERLAY10 = $2000000
WGL_SWAP_UNDERLAY11 = $4000000
WGL_SWAP_UNDERLAY12 = $8000000
WGL_SWAP_UNDERLAY13 = $10000000
WGL_SWAP_UNDERLAY14 = $20000000
WGL_SWAP_UNDERLAY15 = $40000000
WGL_SWAPMULTIPLE_MAX = 16

struct WGLSWAP
       hdc dq ?
       uiFlags dd ?,?
ends

;wincon.h
;    This module contains the public data structures, data types,
;    and procedures exported by the NT console subsystem.
;    26-Oct-1990

struct COORD
       X dw ?
       Y dw ?
ends

struct SMALLRECT
       Left dw ?
       Top dw ?
       Right dw ?
       Bottom dw ?
ends

struct KEYEVENTRECORD
       bKeyDown dd ?
       wRepeatCount dw ?
       wVirtualKeyCode dw ?
       wVirtualScanCode dw ?
       union
	   UnicodeChar dw ?
	   AsciiChar db ?
       ends
       dwControlKeyState dd ?
ends

RIGHT_ALT_PRESSED = 1
LEFT_ALT_PRESSED = 2
RIGHT_CTRL_PRESSED = 4
LEFT_CTRL_PRESSED = 8
SHIFT_PRESSED = $10
NUMLOCK_ON = $20
SCROLLLOCK_ON = $40
CAPSLOCK_ON = $80
ENHANCED_KEY = $100
NLS_DBCSCHAR = $10000
NLS_ALPHANUMERIC = $00000
NLS_KATAKANA = $20000
NLS_HIRAGANA = $40000
NLS_ROMAN = $400000
NLS_IME_CONVERSION = $800000
NLS_IME_DISABLE = $20000000

struct MOUSEEVENTRECORD
       dwMousePosition COORD
       dwButtonState dd ?
       dwControlKeyState dd ?
       dwEventFlags dd ?
ends

FROM_LEFT_1ST_BUTTON_PRESSED = 1
RIGHTMOST_BUTTON_PRESSED = 2
FROM_LEFT_2ND_BUTTON_PRESSED = 4
FROM_LEFT_3RD_BUTTON_PRESSED = 8
FROM_LEFT_4TH_BUTTON_PRESSED = $10

MOUSE_MOVED = 1
DOUBLE_CLICK = 2
MOUSE_WHEELED = 4
MOUSE_HWHEELED = 8

struct WINDOWBUFFERSIZERECORD
       dwSize COORD
ends

struct MENUEVENTRECORD
       dwCommandId dw ?
ends

struct FOCUSEVENTRECORD
       bSetFocus dd ?
ends

struct INPUTRECORD
       EventType dw ?,?
       union
	   KeyEvent KEYEVENTRECORD
	   MouseEvent MOUSEEVENTRECORD
	   WindowBufferSizeEvent WINDOWBUFFERSIZERECORD
	   MenuEvent MENUEVENTRECORD
	   FocusEvent FOCUSEVENTRECORD
       ends
ends

KEY_EVENT = 1
MOUSE_EVENT = 2
WINDOW_BUFFER_SIZE_EVENT = 4
MENU_EVENT = 8
FOCUS_EVENT = 10

struct CHARINFO
       union
	   UnicodeChar dw ?
	   AsciiChar db ?
       ends
       Attributes dw ?
ends

FOREGROUND_BLUE = 1
FOREGROUND_GREEN = 2
FOREGROUND_RED = 4
FOREGROUND_INTENSITY = 8
BACKGROUND_BLUE = $10
BACKGROUND_GREEN = $20
BACKGROUND_RED = $40
BACKGROUND_INTENSITY = $80
COMMON_LVB_LEADING_BYTE = $100
COMMON_LVB_TRAILING_BYTE = $200
COMMON_LVB_GRID_HORIZONTAL = $400
COMMON_LVB_GRID_LVERTICAL = $800
COMMON_LVB_GRID_RVERTICAL = $1000
COMMON_LVB_REVERSE_VIDEO = $4000
COMMON_LVB_UNDERSCORE = $8000
COMMON_LVB_SBCSDBCS = $300

struct CONSOLESCREENBUFFERINFO
       dwSize COORD
       dwCursorPosition COORD
       wAttributes dw ?
       srWindow SMALLRECT
       dwMaximumWindowSize COORD
ends

struct CONSOLESCREENBUFFERINFOEX
       cbSize dd ?
       dwSize COORD
       dwCursorPosition COORD
       wAttributes dw ?
       srWindow SMALLRECT
       dwMaximumWindowSize COORD
       wPopupAttributes dw ?
       bFullscreenSupported dd ?
       ColorTable dd 16 dup(?)
ends

struct CONSOLECURSORINFO
       dwSize dd ?
       bVisible dd ?
ends

struct CONSOLEFONTINFO
       nFont dd ?
       dwFontSize COORD
ends

struct CONSOLEFONTINFOEX
       cbSize dd ?
       nFont dd ?
       dwFontSize COORD
       FontFamily dd ?
       FontWeight dd ?
       FaceName du LF_FACESIZE dup(?)
ends

HISTORY_NO_DUP_FLAG = 1

struct CONSOLEHISTORYINFO
       cbSize dd ?
       HistoryBufferSize dd ?
       NumberOfHistoryBuffers dd ?
       dwFlags dd ?
ends

struct CONSOLESELECTIONINFO
       dwFlags dd ?
       dwSelectionAnchor COORD
       srSelection SMALLRECT
ends

CONSOLE_NO_SELECTION = 0
CONSOLE_SELECTION_IN_PROGRESS = 1
CONSOLE_SELECTION_NOT_EMPTY = 2
CONSOLE_MOUSE_SELECTION = 4
CONSOLE_MOUSE_DOWN = 8

CTRL_C_EVENT = 0
CTRL_BREAK_EVENT = 1
CTRL_CLOSE_EVENT = 2
CTRL_LOGOFF_EVENT = 5
CTRL_SHUTDOWN_EVENT = 6

ENABLE_PROCESSED_INPUT = 1
ENABLE_LINE_INPUT = 2
ENABLE_ECHO_INPUT = 4
ENABLE_WINDOW_INPUT = 8
ENABLE_MOUSE_INPUT = $10
ENABLE_INSERT_MODE = $20
ENABLE_QUICK_EDIT_MODE = $40
ENABLE_EXTENDED_FLAGS = $80
ENABLE_AUTO_POSITION = $100

ENABLE_PROCESSED_OUTPUT = 1
ENABLE_WRAP_AT_EOL_OUTPUT = 2

CONSOLE_REAL_OUTPUT_HANDLE = $fffffffe
CONSOLE_REAL_INPUT_HANDLE = $fffffffd

struct CONSOLEREADCONSOLECONTROL
       nLength dd ?
       nInitialChars dd ?
       dwCtrlWakeupMask dd ?
       dwControlKeyState dd ?
ends

CONSOLE_TEXTMODE_BUFFER = 1
CONSOLE_FULLSCREEN = 1
CONSOLE_FULLSCREEN_HARDWARE = 2


;   commdlg.h -- This module defines the 32-Bit Common Dialog APIs
;   Copyright (c) Microsoft Corporation. All rights reserved.

;IID_IPrintDialogCallback GUID <$5852a2c3>,<$6530>,<$11d1>,<$b6,$a3,0,0,$f8,$75,$7b,$f9>
;IID_IPrintDialogServices GUID <$509aaeda>,<$5639>,<$11d1>,<$b6,$a1,0,0,$f8,$75,$7b,$f9>

struct EDITMENU
       hmenu dq ?
       idEdit dw ?
       idCut dw ?
       idCopy dw ?
       idPaste dw ?
       idClear dw ?
       idUndo dw ?,?,?
ends

struct OPENFILENAMENT4
       lStructSize dd ?,?
       hwndOwner dq ?
       hInstance dq ?
       lpstrFilter dq ?
       lpstrCustomFilter dq ?
       nMaxCustFilter dd ?
       nFilterIndex dd ?
       lpstrFile dq ?
       nMaxFile dd ?,?
       lpstrFileTitle dq ?
       nMaxFileTitle dd ?,?
       lpstrInitialDir dq ?
       lpstrTitle dq ?
       Flags dd ?
       nFileOffset dw ?
       nFileExtension dw ?
       lpstrDefExt dq ?
       lCustData dq ?
       lpfnHook dq ?
       lpTemplateName dq ?
ends

struct OPENFILENAMEA
       lStructSize dd ?,?
       hwndOwner dq ?
       hInstance dq ?
       lpstrFilter dq ?
       lpstrCustomFilter dq ?
       nMaxCustFilter dd ?
       nFilterIndex dd ?
       lpstrFile dq ?
       nMaxFile dd ?,?
       lpstrFileTitle dq ?
       nMaxFileTitle dd ?,?
       lpstrInitialDir dq ?
       lpstrTitle dq ?
       Flags dd ?
       nFileOffset dw ?
       nFileExtension dw ?
       lpstrDefExt dq ?
       lCustData dq ?
       lpfnHook dq ?
       lpTemplateName dq ?
       pvReserved dq ?
       dwReserved dd ?
       FlagsEx dd ?
ends

struct OPENFILENAMEW
       lStructSize dd ?,?
       hwndOwner dq ?
       hInstance dq ?
       lpstrFilter dq ?
       lpstrCustomFilter dq ?
       nMaxCustFilter dd ?
       nFilterIndex dd ?
       lpstrFile dq ?
       nMaxFile dd ?,?
       lpstrFileTitle dq ?
       nMaxFileTitle dd ?,?
       lpstrInitialDir dq ?
       lpstrTitle dq ?
       Flags dd ?
       nFileOffset dw ?
       nFileExtension dw ?
       lpstrDefExt dq ?
       lCustData dq ?
       lpfnHook dq ?
       lpTemplateName dq ?
       pvReserved dq ?
       dwReserved dd ?
       FlagsEx dd ?
ends

OFN_READONLY = 1
OFN_OVERWRITEPROMPT = 2
OFN_HIDEREADONLY = 4
OFN_NOCHANGEDIR = 8
OFN_SHOWHELP = $10
OFN_ENABLEHOOK = $20
OFN_ENABLETEMPLATE = $40
OFN_ENABLETEMPLATEHANDLE = $80
OFN_NOVALIDATE = $100
OFN_ALLOWMULTISELECT = $200
OFN_EXTENSIONDIFFERENT = $400
OFN_PATHMUSTEXIST = $800
OFN_FILEMUSTEXIST = $1000
OFN_CREATEPROMPT = $2000
OFN_SHAREAWARE = $4000
OFN_NOREADONLYRETURN = $8000
OFN_NOTESTFILECREATE = $10000
OFN_NONETWORKBUTTON = $20000
OFN_NOLONGNAMES = $40000
OFN_EXPLORER = $80000
OFN_NODEREFERENCELINKS = $100000
OFN_LONGNAMES = $200000
OFN_ENABLEINCLUDENOTIFY = $400000
OFN_ENABLESIZING = $800000
OFN_DONTADDTORECENT = $2000000
OFN_FORCESHOWHIDDEN = $10000000
OFN_EX_NOPLACESBAR = 1
OFN_SHAREFALLTHROUGH = 2
OFN_SHARENOWARN = 1
OFN_SHAREWARN = 0

struct OFNOTIFYA
       hdr NMHDR
       lpOFN dq ?
       pszFile dd ?,?
ends

struct OFNOTIFYW
       hdr NMHDR
       lpOFN dq ?
       pszFile dd ?,?
ends

struct OFNOTIFYEXA
       hdr NMHDR
       lpOFN dq ?
       psf dq ?
       pidl dq ?
ends

struct OFNOTIFYEXW
       hdr NMHDR
       lpOFN dq ?
       psf dq ?
       pidl dq ?
ends

CDN_FIRST = (0-601)
CDN_LAST = (0-699)
CDN_INITDONE = (CDN_FIRST - 0)
CDN_SELCHANGE = (CDN_FIRST - 1)
CDN_FOLDERCHANGE = (CDN_FIRST - 2)
CDN_SHAREVIOLATION = (CDN_FIRST - 3)
CDN_HELP = (CDN_FIRST - 4)
CDN_FILEOK = (CDN_FIRST - 5)
CDN_TYPECHANGE = (CDN_FIRST - 6)
CDN_INCLUDEITEM = (CDN_FIRST - 7)

CDM_FIRST = (WM_USER + 100)
CDM_LAST = (WM_USER + 200)

CDM_GETSPEC = (CDM_FIRST + 0)
CDM_GETFILEPATH = (CDM_FIRST + 1)
CDM_GETFOLDERPATH = (CDM_FIRST + 2)
CDM_GETFOLDERIDLIST = (CDM_FIRST + 3)
CDM_SETCONTROLTEXT = (CDM_FIRST + 4)
CDM_HIDECONTROL = (CDM_FIRST + 5)
CDM_SETDEFEXT = (CDM_FIRST + 6)

struct CHOOSECOLORA
       lStructSize dd ?,?
       hwndOwner dq ?
       hInstance dq ?
       rgbResult dd ?,?
       lpCustColors dq ?
       Flags dd ?,?
       lCustData dq ?
       lpfnHook dq ?
       lpTemplateName dq ?
ends

struct CHOOSECOLORW
       lStructSize dd ?,?
       hwndOwner dq ?
       hInstance dq ?
       rgbResult dd ?,?
       lpCustColors dq ?
       Flags dd ?,?
       lCustData dq ?
       lpfnHook dq ?
       lpTemplateName dq ?
ends

CC_RGBINIT		 = 1
CC_FULLOPEN		 = 2
CC_PREVENTFULLOPEN	 = 4
CC_SHOWHELP		 = 8
CC_ENABLEHOOK		 = $10
CC_ENABLETEMPLATE	 = $20
CC_ENABLETEMPLATEHANDLE  = $40
CC_SOLIDCOLOR		 = $80
CC_ANYCOLOR		 = $100

struct FINDREPLACEA
       lStructSize dd ?,?
       hwndOwner dq ?
       hInstance dq ?
       Flags dd ?,?
       lpstrFindWhat dq ?
       lpstrReplaceWith dq ?
       wFindWhatLen dw ?
       wReplaceWithLen dw ?,?,?
       lCustData dq ?
       lpfnHook dq ?
       lpTemplateName dq ?
ends

struct FINDREPLACEW
       lStructSize dd ?,?
       hwndOwner dq ?
       hInstance dq ?
       Flags dd ?,?
       lpstrFindWhat dq ?
       lpstrReplaceWith dq ?
       wFindWhatLen dw ?
       wReplaceWithLen dw ?,?,?
       lCustData dq ?
       lpfnHook dq ?
       lpTemplateName dq ?
ends

FR_DOWN = 1
FR_WHOLEWORD = 2
FR_MATCHCASE = 4
FR_FINDNEXT = 8
FR_REPLACE = $10
FR_REPLACEALL = $20
FR_DIALOGTERM = $40
FR_SHOWHELP = $80
FR_ENABLEHOOK = $100
FR_ENABLETEMPLATE = $200
FR_NOUPDOWN = $400
FR_NOMATCHCASE = $800
FR_NOWHOLEWORD = $1000
FR_ENABLETEMPLATEHANDLE = $2000
FR_HIDEUPDOWN = $4000
FR_HIDEMATCHCASE = $8000
FR_HIDEWHOLEWORD = $10000
FR_RAW = $20000
FR_MATCHDIAC = $20000000
FR_MATCHKASHIDA = $40000000
FR_MATCHALEFHAMZA = $80000000

struct CHOOSEFONTA
       lStructSize dd ?,?
       hwndOwner dq ?
       hDC dq ?
       lpLogFont dq ?
       iPointSize dd ?
       Flags dd ?
       rgbColors dd ?,?
       lCustData dq ?
       lpfnHook dq ?
       lpTemplateName dq ?
       hInstance dq ?
       lpszStyle dq ?
       nFontType dw ?,?
       nSizeMin dd ?
       nSizeMax dd ?
       pad1 dd ?
ends

struct CHOOSEFONTW
       lStructSize dd ?,?
       hwndOwner dq ?
       hDC dq ?
       lpLogFont dq ?
       iPointSize dd ?
       Flags dd ?
       rgbColors dd ?,?
       lCustData dq ?
       lpfnHook dq ?
       lpTemplateName dq ?
       hInstance dq ?
       lpszStyle dq ?
       nFontType dw ?,?
       nSizeMin dd ?
       nSizeMax dd ?
       pad1 dd ?
ends

CF_SCREENFONTS = 1
CF_PRINTERFONTS = 2
CF_BOTH = (CF_SCREENFONTS or CF_PRINTERFONTS)
CF_SHOWHELP = 4
CF_ENABLEHOOK = 8
CF_ENABLETEMPLATE = $10
CF_ENABLETEMPLATEHANDLE    = $20
CF_INITTOLOGFONTSTRUCT	   = $40
CF_USESTYLE = $80
CF_EFFECTS = $100
CF_APPLY = $200
CF_ANSIONLY = $400
CF_SCRIPTSONLY = CF_ANSIONLY
CF_NOVECTORFONTS = $800
CF_NOOEMFONTS = CF_NOVECTORFONTS
CF_NOSIMULATIONS = $1000
CF_LIMITSIZE = $2000
CF_FIXEDPITCHONLY = $4000
CF_WYSIWYG = $8000
CF_FORCEFONTEXIST = $10000
CF_SCALABLEONLY = $20000
CF_TTONLY = $40000
CF_NOFACESEL = $80000
CF_NOSTYLESEL = $100000
CF_NOSIZESEL = $200000
CF_SELECTSCRIPT = $400000
CF_NOSCRIPTSEL = $800000
CF_NOVERTFONTS = $1000000

SIMULATED_FONTTYPE = $8000
PRINTER_FONTTYPE = $4000
SCREEN_FONTTYPE = $2000
BOLD_FONTTYPE = $100
ITALIC_FONTTYPE = $200
REGULAR_FONTTYPE = $400

PS_OPENTYPE_FONTTYPE = $10000
TT_OPENTYPE_FONTTYPE = $20000
TYPE1_FONTTYPE = $40000

WM_CHOOSEFONT_GETLOGFONT = (WM_USER + 1)
WM_CHOOSEFONT_SETLOGFONT = (WM_USER + 101)
WM_CHOOSEFONT_SETFLAGS = (WM_USER + 102)

LBSELCHSTRINGA equ "commdlg_LBSelChangedNotify"
SHAREVISTRINGA equ "commdlg_ShareViolation"
FILEOKSTRINGA equ "commdlg_FileNameOK"
COLOROKSTRINGA equ "commdlg_ColorOK"
SETRGBSTRINGA equ "commdlg_SetRGBColor"
HELPMSGSTRINGA equ "commdlg_help"
FINDMSGSTRINGA equ "commdlg_FindReplace"

LBSELCHSTRINGW equ "commdlg_LBSelChangedNotify"
SHAREVISTRINGW equ "commdlg_ShareViolation"
FILEOKSTRINGW equ "commdlg_FileNameOK"
COLOROKSTRINGW equ "commdlg_ColorOK"
SETRGBSTRINGW equ "commdlg_SetRGBColor"
HELPMSGSTRINGW equ "commdlg_help"
FINDMSGSTRINGW equ "commdlg_FindReplace"

CD_LBSELNOITEMS = -1
CD_LBSELCHANGE = 0
CD_LBSELSUB = 1
CD_LBSELADD = 2

struct PRINTDLGA
       lStructSize dd ?,?
       hwndOwner dq ?
       hDevMode dq ?
       hDevNames dq ?
       hDC dq ?
       Flags dd ?
       nFromPage dw ?
       nToPage dw ?
       nMinPage dw ?
       nMaxPage dw ?
       nCopies dw ?,?
       hInstance dq ?
       lCustData dq ?
       lpfnPrintHook dq ?
       lpfnSetupHook dq ?
       lpPrintTemplateName dq ?
       lpSetupTemplateName dq ?
       hPrintTemplate dq ?
       hSetupTemplate dq ?
ends

struct PRINTDLGW
       lStructSize dd ?,?
       hwndOwner dq ?
       hDevMode dq ?
       hDevNames dq ?
       hDC dq ?
       Flags dd ?
       nFromPage dw ?
       nToPage dw ?
       nMinPage dw ?
       nMaxPage dw ?
       nCopies dw ?,?
       hInstance dq ?
       lCustData dq ?
       lpfnPrintHook dq ?
       lpfnSetupHook dq ?
       lpPrintTemplateName dq ?
       lpSetupTemplateName dq ?
       hPrintTemplate dq ?
       hSetupTemplate dq ?
ends

interface IPrintDialogCallback,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  InitDone,\
	  SelectionChange,\
	  HandleMessage

interface IPrintDialogServices,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetCurrentDevMode,\
	  GetCurrentPrinterName,\
	  GetCurrentPortName

struct PRINTPAGERANGE
       nFromPage dd ?
       nToPage dd ?
ends

struct PRINTDLGEXA
       lStructSize dd ?,?
       hwndOwner dq ?
       hDevMode dq ?
       hDevNames dq ?
       hDC dq ?
       Flags dd ?
       Flags2 dd ?
       ExclusionFlags dd ?
       nPageRanges dd ?
       nMaxPageRanges dd ?,?
       lpPageRanges dq ?
       nMinPage dd ?
       nMaxPage dd ?
       nCopies dd ?,?
       hInstance dq ?
       lpPrintTemplateName dq ?
       lpCallback dq ?
       nPropertyPages dd ?,?
       lphPropertyPages dq ?
       nStartPage dd ?
       dwResultAction dd ?
ends

struct PRINTDLGEXW
       lStructSize dd ?,?
       hwndOwner dq ?
       hDevMode dq ?
       hDevNames dq ?
       hDC dq ?
       Flags dd ?
       Flags2 dd ?
       ExclusionFlags dd ?
       nPageRanges dd ?
       nMaxPageRanges dd ?,?
       lpPageRanges dq ?
       nMinPage dd ?
       nMaxPage dd ?
       nCopies dd ?,?
       hInstance dq ?
       lpPrintTemplateName dq ?
       lpCallback dq ?
       nPropertyPages dd ?,?
       lphPropertyPages dq ?
       nStartPage dd ?
       dwResultAction dd ?
ends

PD_ALLPAGES = 0
PD_SELECTION = 1
PD_PAGENUMS = 2
PD_NOSELECTION = 4
PD_NOPAGENUMS = 8
PD_COLLATE = $10
PD_PRINTTOFILE = $20
PD_PRINTSETUP = $40
PD_NOWARNING = $80
PD_RETURNDC = $100
PD_RETURNIC = $200
PD_RETURNDEFAULT = $400
PD_SHOWHELP = $800
PD_ENABLEPRINTHOOK = $1000
PD_ENABLESETUPHOOK = $2000
PD_ENABLEPRINTTEMPLATE = $4000
PD_ENABLESETUPTEMPLATE = $8000
PD_ENABLEPRINTTEMPLATEHANDLE = $10000
PD_ENABLESETUPTEMPLATEHANDLE = $20000
PD_USEDEVMODECOPIES = $40000
PD_USEDEVMODECOPIESANDCOLLATE = $40000
PD_DISABLEPRINTTOFILE = $80000
PD_HIDEPRINTTOFILE = $100000
PD_NONETWORKBUTTON = $200000
PD_CURRENTPAGE = $400000
PD_NOCURRENTPAGE = $800000
PD_EXCLUSIONFLAGS = $1000000
PD_USELARGETEMPLATE = $10000000
PD_EXCL_COPIESANDCOLLATE = (DM_COPIES or DM_COLLATE)
START_PAGE_GENERAL = $ffffffff
PD_RESULT_CANCEL = 0
PD_RESULT_PRINT = 1
PD_RESULT_APPLY = 2

struct DEVNAMES
       wDriverOffset dw ?
       wDeviceOffset dw ?
       wOutputOffset dw ?
       wDefault dw ?
ends

DN_DEFAULTPRN = 1

WM_PSD_PAGESETUPDLG =  WM_USER
WM_PSD_FULLPAGERECT = (WM_USER + 1)
WM_PSD_MINMARGINRECT = (WM_USER + 2)
WM_PSD_MARGINRECT = (WM_USER + 3)
WM_PSD_GREEKTEXTRECT = (WM_USER + 4)
WM_PSD_ENVSTAMPRECT = (WM_USER + 5)
WM_PSD_YAFULLPAGERECT = (WM_USER + 6)

struct PAGESETUPDLGA
       lStructSize dd ?,?
       hwndOwner dq ?
       hDevMode dq ?
       hDevNames dq ?
       Flags dd ?
       ptPaperSize POINT
       rtMinMargin RECT
       rtMargin RECT
       pad1 dd ?
       hInstance dq ?
       lCustData dq ?
       lpfnPageSetupHook dq ?
       lpfnPagePaintHook dq ?
       lpPageSetupTemplateName dq ?
       hPageSetupTemplate dq ?
ends

struct PAGESETUPDLGW
       lStructSize dd ?,?
       hwndOwner dq ?
       hDevMode dq ?
       hDevNames dq ?
       Flags dd ?
       ptPaperSize POINT
       rtMinMargin RECT
       rtMargin RECT
       pad1 dd ?
       hInstance dq ?
       lCustData dq ?
       lpfnPageSetupHook dq ?
       lpfnPagePaintHook dq ?
       lpPageSetupTemplateName dq ?
       hPageSetupTemplate dq ?
ends

PSD_DEFAULTMINMARGINS = 0
PSD_INWININIINTLMEASURE = 0
PSD_MINMARGINS = 1
PSD_MARGINS = 2
PSD_INTHOUSANDTHSOFINCHES = 4
PSD_INHUNDREDTHSOFMILLIMETERS = 8
PSD_DISABLEMARGINS = $10
PSD_DISABLEPRINTER = $20
PSD_NOWARNING = $80
PSD_DISABLEORIENTATION = $100
PSD_RETURNDEFAULT = $400
PSD_DISABLEPAPER = $200
PSD_SHOWHELP = $800
PSD_ENABLEPAGESETUPHOOK = $2000
PSD_ENABLEPAGESETUPTEMPLATE = $8000
PSD_ENABLEPAGESETUPTEMPLATEHANDLE = $20000
PSD_ENABLEPAGEPAINTHOOK = $40000
PSD_DISABLEPAGEPAINTING = $80000
PSD_NONETWORKBUTTON = $200000


;commctrl.h - - Interface for the Windows Common Controls
;Version 1.2
;Copyright (c) Microsoft Corporation. All rights reserved.

;#include <prsht.h>

struct INITCOMMONCONTROLSEX
       dwSize dd ?
       dwICC dd ?
ends

ICC_LISTVIEW_CLASSES = 1
ICC_TREEVIEW_CLASSES = 2
ICC_BAR_CLASSES = 4
ICC_TAB_CLASSES = 8
ICC_UPDOWN_CLASS = $10
ICC_PROGRESS_CLASS = $20
ICC_HOTKEY_CLASS = $40
ICC_ANIMATE_CLASS = $80
ICC_WIN95_CLASSES = $FF
ICC_DATE_CLASSES = $100
ICC_USEREX_CLASSES = $200
ICC_COOL_CLASSES = $400
ICC_INTERNET_CLASSES = $800
ICC_PAGESCROLLER_CLASS = $1000
ICC_NATIVEFNTCTL_CLASS = $2000
ICC_STANDARD_CLASSES = $4000
ICC_LINK_CLASS = $8000
ICC_ALL_CLASSES = $ffff

ODT_HEADER = 100
ODT_TAB = 101
ODT_LISTVIEW = 102

LVM_FIRST = $1000
TV_FIRST = $1100
HDM_FIRST = $1200
TCM_FIRST = $1300
PGM_FIRST = $1400
ECM_FIRST = $1500
BCM_FIRST = $1600
CBM_FIRST = $1700
CCM_FIRST = $2000
CCM_LAST = (CCM_FIRST + 0x200)
CCM_SETBKCOLOR = (CCM_FIRST + 1)

struct COLORSCHEME
       dwSize dd ?
       clrBtnHighlight dd ?
       clrBtnShadow dd ?
ends

CCM_SETCOLORSCHEME = (CCM_FIRST + 2)
CCM_GETCOLORSCHEME = (CCM_FIRST + 3)
CCM_GETDROPTARGET = (CCM_FIRST + 4)
CCM_SETUNICODEFORMAT = (CCM_FIRST + 5)
CCM_GETUNICODEFORMAT = (CCM_FIRST + 6)

COMCTL32_VERSION = 6

CCM_SETVERSION = (CCM_FIRST + 0x7)
CCM_GETVERSION = (CCM_FIRST + 0x8)
CCM_SETNOTIFYWINDOW = (CCM_FIRST + 0x9)
CCM_SETWINDOWTHEME = (CCM_FIRST + 0xb)
CCM_DPISCALE = (CCM_FIRST + 0xc)

INFOTIPSIZE = 1024

NM_OUTOFMEMORY = (NM_FIRST-1)
NM_CLICK = (NM_FIRST-2)
NM_DBLCLK = (NM_FIRST-3)
NM_RETURN = (NM_FIRST-4)
NM_RCLICK = (NM_FIRST-5)
NM_RDBLCLK = (NM_FIRST-6)
NM_SETFOCUS = (NM_FIRST-7)
NM_KILLFOCUS = (NM_FIRST-8)
NM_CUSTOMDRAW = (NM_FIRST-12)
NM_HOVER = (NM_FIRST-13)
NM_NCHITTEST = (NM_FIRST-14)
NM_KEYDOWN = (NM_FIRST-15)
NM_RELEASEDCAPTURE = (NM_FIRST-16)
NM_SETCURSOR = (NM_FIRST-17)
NM_CHAR = (NM_FIRST-18)
NM_TOOLTIPSCREATED = (NM_FIRST-19)
NM_LDOWN = (NM_FIRST-20)
NM_RDOWN = (NM_FIRST-21)
NM_THEMECHANGED = (NM_FIRST-22)

struct NMTOOLTIPSCREATED
       hdr NMHDR
       hwndToolTips dq ?
ends

struct NMMOUSE
       hdr NMHDR
       dwItemSpec dq ?
       dwItemData dq ?
       pt POINT
       dwHitInfo dq ?
ends

struct NMOBJECTNOTIFY
       hdr NMHDR
       iItem dd ?
       piid dq ?
       pObject dq ?
       hResult dq ?
       dwFlags dd ?,?
ends

struct NMKEY
       hdr NMHDR
       nVKey dd ?
       uFlags dd ?
ends

struct NMCHAR
       hdr NMHDR
       ch dd ?
       dwItemPrev dd ?
       dwItemNext dd ?
ends

NM_FIRST = (0-	0)
NM_LAST = (0- 99)
LVN_FIRST = (0 - 100)
LVN_LAST = (0 - 199)
HDN_FIRST = (0 - 300)
HDN_LAST = (0 - 399)
TVN_FIRST = (0 - 400)
TVN_LAST = (0 - 499)
TTN_FIRST = (0 - 520)
TTN_LAST = (0 - 549)
TCN_FIRST = (0 - 550)
TCN_LAST = (0 - 580)
CDN_FIRST = (0 - 601)
CDN_LAST = (0 - 699)
TBN_FIRST = (0 - 700)
TBN_LAST = (0 - 720)
UDN_FIRST = (0 - 721)
UDN_LAST = (0 - 740)
MCN_FIRST = (0 - 750)
MCN_LAST = (0 - 759)
DTN_FIRST = (0 - 760)
DTN_LAST = (0 - 799)
CBEN_FIRST = (0 - 800)
CBEN_LAST = (0 - 830)
RBN_FIRST = (0 - 831)
RBN_LAST = (0 - 859)
IPN_FIRST = (0 - 860)
IPN_LAST = (0 - 879)
SBN_FIRST = (0 - 880)
SBN_LAST = (0 - 899)
PGN_FIRST = (0 - 900)
PGN_LAST = (0 - 950)
WMN_FIRST = (0 - 1000)
WMN_LAST = (0 - 1200)
BCN_FIRST = (0 - 1250)
BCN_LAST = (0 - 1350)

MSGF_COMMCTRL_BEGINDRAG = $4200
MSGF_COMMCTRL_SIZEHEADER = $4201
MSGF_COMMCTRL_DRAGSELECT = $4202
MSGF_COMMCTRL_TOOLBARCUST = $4203

CDRF_DODEFAULT = 0
CDRF_NEWFONT = 2
CDRF_SKIPDEFAULT = 4
CDRF_NOTIFYPOSTPAINT = $10
CDRF_NOTIFYITEMDRAW = $20
CDRF_NOTIFYSUBITEMDRAW = $20
CDRF_NOTIFYPOSTERASE = $40

CDDS_PREPAINT = 1
CDDS_POSTPAINT = 2
CDDS_PREERASE = 3
CDDS_POSTERASE = 4
CDDS_ITEM = $10000
CDDS_ITEMPREPAINT = (CDDS_ITEM or CDDS_PREPAINT)
CDDS_ITEMPOSTPAINT = (CDDS_ITEM or CDDS_POSTPAINT)
CDDS_ITEMPREERASE = (CDDS_ITEM or CDDS_PREERASE)
CDDS_ITEMPOSTERASE = (CDDS_ITEM or CDDS_POSTERASE)
CDDS_SUBITEM = $20000

CDIS_SELECTED = 1
CDIS_GRAYED = 2
CDIS_DISABLED = 4
CDIS_CHECKED = 8
CDIS_FOCUS = $10
CDIS_DEFAULT = $20
CDIS_HOT = $40
CDIS_MARKED = $80
CDIS_INDETERMINATE = $100
CDIS_SHOWKEYBOARDCUES = $200

struct NMCUSTOMDRAW
       hdr NMHDR
       dwDrawStage dd ?,?
       hdc dq ?
       rc RECT
       dwItemSpec dq ?
       uItemState dd ?,?
       lItemlParam dq ?
ends

struct NMTTCUSTOMDRAW
       nmcd NMCUSTOMDRAW
       uDrawFlags dd ?,?
ends

CLR_NONE = $FFFFFFFF
CLR_DEFAULT = $FF000000

struct IMAGELISTDRAWPARAMS
       cbSize dd ?,?
       himl dq ?
       i dd ?,?
       hdcDst dq ?
       x dd ?
       y dd ?
       cx dd ?
       cy dd ?
       xBitmap dd ?
       yBitmap dd ?
       rgbBk dd ?
       rgbFg dd ?
       fStyle dd ?
       dwRop dd ?
       fState dd ?
       Frame dd ?
       crEffect dd ?,?
ends

ILC_MASK = 1
ILC_COLOR = 0
ILC_COLORDDB = $FE
ILC_COLOR4 = 4
ILC_COLOR8 = 8
ILC_COLOR16 = $10
ILC_COLOR24 = $18
ILC_COLOR32 = $20
ILC_PALETTE = $800
ILC_MIRROR = $2000
ILC_PERITEMMIRROR = $8000

ILD_NORMAL = 0
ILD_TRANSPARENT = 1
ILD_MASK = $10
ILD_IMAGE = $20
ILD_ROP = $40
ILD_BLEND25 = 2
ILD_BLEND50 = 4
ILD_OVERLAYMASK = $F00
ILD_PRESERVEALPHA = $1000
ILD_SCALE = $2000
ILD_DPISCALE = $4000
ILD_SELECTED = ILD_BLEND50
ILD_FOCUS = ILD_BLEND25
ILD_BLEND = ILD_BLEND50

CLR_HILIGHT = CLR_DEFAULT

ILS_NORMAL = 0
ILS_GLOW = 1
ILS_SHADOW = 2
ILS_SATURATE = 4
ILS_ALPHA = 8

ILCF_MOVE = 0
ILCF_SWAP = 1

ILP_NORMAL = 0
ILP_DOWNLEVEL = 1

struct IMAGEINFO
       hbmImage dq ?
       hbmMask dq ?
       Unused1 dd ?
       Unused2 dd ?
       rcImage RECT
ends

WC_HEADERA equ "SysHeader32"
WC_HEADERW equ "SysHeader32"
WC_HEADER  equ "SysHeader"

HDS_HORZ = 0
HDS_BUTTONS = 2
HDS_HOTTRACK = 4
HDS_HIDDEN = 8
HDS_DRAGDROP = $40
HDS_FULLDRAG = $80
HDS_FILTERBAR = $100
HDS_FLAT = $200

HDFT_ISSTRING = 0
HDFT_ISNUMBER = 1
HDFT_HASNOVALUE = $8000

struct HDTEXTFILTERA
       pszText dq ?
       cchTextMax dd ?,?
ends

struct HDTEXTFILTERW
       pszText dq ?
       cchTextMax dd ?,?
ends

struct HDITEMA
       mask dd ?
       cxy dd ?
       pszText dq ?
       hbm dq ?
       cchTextMax dd ?
       fmt dd ?
       lParam dq ?
       iImage dd ?
       iOrder dd ?
       type dd ?,?
       pvFilter dq ?
       state dd ?,?
ends

struct HDITEMW
       mask dd ?
       cxy dd ?
       pszText dq ?
       hbm dq ?
       cchTextMax dd ?
       fmt dd ?
       lParam dq ?
       iImage dd ?
       iOrder dd ?
       type dd ?,?
       pvFilter dq ?
       state dd ?,?
ends

HDI_WIDTH = 1
HDI_HEIGHT = HDI_WIDTH
HDI_TEXT = 2
HDI_FORMAT = 4
HDI_LPARAM = 8
HDI_BITMAP = $10
HDI_IMAGE = $20
HDI_DI_SETITEM = $40
HDI_ORDER = $80
HDI_FILTER = $100

HDF_LEFT = 0
HDF_RIGHT = 1
HDF_CENTER = 2
HDF_JUSTIFYMASK = 3
HDF_RTLREADING = 4
HDF_OWNERDRAW = $8000
HDF_STRING = $4000
HDF_BITMAP = $2000
HDF_BITMAP_ON_RIGHT = $1000
HDF_IMAGE = $800
HDF_SORTUP = $400
HDF_SORTDOWN = $200

HDM_GETITEMCOUNT = (HDM_FIRST + 0)
HDM_INSERTITEMA = (HDM_FIRST + 1)
HDM_INSERTITEMW = (HDM_FIRST + 10)
HDM_DELETEITEM = (HDM_FIRST + 2)
HDM_GETITEMA = (HDM_FIRST + 3)
HDM_GETITEMW = (HDM_FIRST + 11)
HDM_SETITEMA = (HDM_FIRST + 4)
HDM_SETITEMW = (HDM_FIRST + 12)

struct HDLAYOUT
       prc dq ?
       pwpos dq ?
ends

HDM_LAYOUT = (HDM_FIRST + 5)

HHT_NOWHERE = 1
HHT_ONHEADER = 2
HHT_ONDIVIDER = 4
HHT_ONDIVOPEN = 8
HHT_ONFILTER = $10
HHT_ONFILTERBUTTON = $20
HHT_ABOVE = $100
HHT_BELOW = $200
HHT_TORIGHT = $400
HHT_TOLEFT = $800

struct HDHITTESTINFO
       pt POINT
       flags dd ?
       iItem dd ?
ends

HDM_HITTEST = (HDM_FIRST + 6)
HDM_GETITEMRECT = (HDM_FIRST + 7)
HDM_SETIMAGELIST = (HDM_FIRST + 8)
HDM_GETIMAGELIST = (HDM_FIRST + 9)
HDM_ORDERTOINDEX = (HDM_FIRST + 15)
HDM_CREATEDRAGIMAGE = (HDM_FIRST + 16)
HDM_GETORDERARRAY = (HDM_FIRST + 17)
HDM_SETORDERARRAY = (HDM_FIRST + 18)
HDM_SETHOTDIVIDER = (HDM_FIRST + 19)
HDM_SETBITMAPMARGIN = (HDM_FIRST + 20)
HDM_GETBITMAPMARGIN = (HDM_FIRST + 21)
HDM_SETUNICODEFORMAT = CCM_SETUNICODEFORMAT
HDM_GETUNICODEFORMAT = CCM_GETUNICODEFORMAT
HDM_SETFILTERCHANGETIMEOUT = (HDM_FIRST+22)
HDM_EDITFILTER = (HDM_FIRST+23)
HDM_CLEARFILTER = (HDM_FIRST+24)

HDN_ITEMCHANGINGA = (HDN_FIRST-0)
HDN_ITEMCHANGINGW = (HDN_FIRST-20)
HDN_ITEMCHANGEDA = (HDN_FIRST-1)
HDN_ITEMCHANGEDW = (HDN_FIRST-21)
HDN_ITEMCLICKA = (HDN_FIRST-2)
HDN_ITEMCLICKW = (HDN_FIRST-22)
HDN_ITEMDBLCLICKA = (HDN_FIRST-3)
HDN_ITEMDBLCLICKW = (HDN_FIRST-23)
HDN_DIVIDERDBLCLICKA = (HDN_FIRST-5)
HDN_DIVIDERDBLCLICKW = (HDN_FIRST-25)
HDN_BEGINTRACKA = (HDN_FIRST-6)
HDN_BEGINTRACKW = (HDN_FIRST-26)
HDN_ENDTRACKA = (HDN_FIRST-7)
HDN_ENDTRACKW = (HDN_FIRST-27)
HDN_TRACKA = (HDN_FIRST-8)
HDN_TRACKW = (HDN_FIRST-28)
HDN_GETDISPINFOA = (HDN_FIRST-9)
HDN_GETDISPINFOW = (HDN_FIRST-29)
HDN_BEGINDRAG = (HDN_FIRST-10)
HDN_ENDDRAG = (HDN_FIRST-11)
HDN_FILTERCHANGE = (HDN_FIRST-12)
HDN_FILTERBTNCLICK = (HDN_FIRST-13)

struct NMHEADERA
       hdr NMHDR
       iItem dd ?
       iButton dd ?
       pitem dq ?
ends

struct NMHEADERW
       hdr NMHDR
       iItem dd ?
       iButton dd ?
       pitem dq ?
ends

struct NMHDDISPINFOA
       hdr NMHDR
       iItem dd ?
       mask dd ?
       pszText dq ?
       cchTextMax dd ?
       iImage dd ?
       lParam dq ?
ends

struct NMHDDISPINFOW
       hdr NMHDR
       iItem dd ?
       mask dd ?
       pszText dq ?
       cchTextMax dd ?
       iImage dd ?
       lParam dq ?
ends

struct NMHDFILTERBTNCLICK
       hdr NMHDR
       iItem dd ?
       rc RECT
ends


TOOLBARCLASSNAMEW equ "ToolbarWindow32"
TOOLBARCLASSNAMEA equ "ToolbarWindow32"
TOOLBARCLASSNAME equ "ToolbarWindow"

struct TBBUTTON
       iBitmap dd ?
       idCommand dd ?
       fsState db ?
       fsStyle db ?
       bReserved db 6 dup(?)
       dwData dq ?
       iString dq ?
ends

struct COLORMAP
       from dd ?
       too dd ?
ends

CMB_MASKED = 2
TBSTATE_CHECKED = 1
TBSTATE_PRESSED = 2
TBSTATE_ENABLED = 4
TBSTATE_HIDDEN = 8
TBSTATE_INDETERMINATE = $10
TBSTATE_WRAP = $20
TBSTATE_ELLIPSES = $40
TBSTATE_MARKED = $80
TBSTYLE_BUTTON = 0
TBSTYLE_SEP = 1
TBSTYLE_CHECK = 2
TBSTYLE_GROUP = 4
TBSTYLE_CHECKGROUP = (TBSTYLE_GROUP or TBSTYLE_CHECK)
TBSTYLE_DROPDOWN = 8
TBSTYLE_AUTOSIZE = $10
TBSTYLE_NOPREFIX = $20
TBSTYLE_TOOLTIPS = $100
TBSTYLE_WRAPABLE = $200
TBSTYLE_ALTDRAG = $400
TBSTYLE_FLAT = $800
TBSTYLE_LIST = $1000
TBSTYLE_CUSTOMERASE = $2000
TBSTYLE_REGISTERDROP = $4000
TBSTYLE_TRANSPARENT = $8000
TBSTYLE_EX_DRAWDDARROWS = 1

BTNS_BUTTON = TBSTYLE_BUTTON
BTNS_SEP = TBSTYLE_SEP
BTNS_CHECK = TBSTYLE_CHECK
BTNS_GROUP = TBSTYLE_GROUP
BTNS_CHECKGROUP = TBSTYLE_CHECKGROUP
BTNS_DROPDOWN = TBSTYLE_DROPDOWN
BTNS_AUTOSIZE = TBSTYLE_AUTOSIZE
BTNS_NOPREFIX = TBSTYLE_NOPREFIX
BTNS_SHOWTEXT = $40
BTNS_WHOLEDROPDOWN = $80

TBSTYLE_EX_MIXEDBUTTONS = 8
TBSTYLE_EX_HIDECLIPPEDBUTTONS = $10
TBSTYLE_EX_DOUBLEBUFFER = $80

struct NMTBCUSTOMDRAW
       nmcd NMCUSTOMDRAW
       hbrMonoDither dq ?
       hbrLines dq ?
       hpenLines dq ?
       clrText dd ?
       clrMark dd ?
       clrTextHighlight dd ?
       clrBtnFace dd ?
       clrBtnHighlight dd ?
       clrHighlightHotTrack dd ?
       rcText RECT
       nStringBkMode dd ?
       nHLStringBkMode dd ?
       iListGap dd ?,?
ends

TBCDRF_NOEDGES = $10000
TBCDRF_HILITEHOTTRACK = $20000
TBCDRF_NOOFFSET = $40000
TBCDRF_NOMARK = $80000
TBCDRF_NOETCHEDEFFECT = $100000
TBCDRF_BLENDICON = $200000
TBCDRF_NOBACKGROUND  = $400000

TB_ENABLEBUTTON = (WM_USER + 1)
TB_CHECKBUTTON = (WM_USER + 2)
TB_PRESSBUTTON = (WM_USER + 3)
TB_HIDEBUTTON = (WM_USER + 4)
TB_INDETERMINATE = (WM_USER + 5)
TB_MARKBUTTON = (WM_USER + 6)
TB_ISBUTTONENABLED = (WM_USER + 9)
TB_ISBUTTONCHECKED = (WM_USER + 10)
TB_ISBUTTONPRESSED = (WM_USER + 11)
TB_ISBUTTONHIDDEN = (WM_USER + 12)
TB_ISBUTTONINDETERMINATE = (WM_USER + 13)
TB_ISBUTTONHIGHLIGHTED = (WM_USER + 14)
TB_SETSTATE = (WM_USER + 17)
TB_GETSTATE = (WM_USER + 18)
TB_ADDBITMAP = (WM_USER + 19)

struct TBADDBITMAP
       hInst dq ?
       nID dq ?
ends

HINST_COMMCTRL = -1
IDB_STD_SMALL_COLOR = 0
IDB_STD_LARGE_COLOR = 1
IDB_VIEW_SMALL_COLOR = 4
IDB_VIEW_LARGE_COLOR = 5
IDB_HIST_SMALL_COLOR = 8
IDB_HIST_LARGE_COLOR = 9

STD_CUT = 0
STD_COPY = 1
STD_PASTE = 2
STD_UNDO = 3
STD_REDOW = 4
STD_DELETE = 5
STD_FILENEW = 6
STD_FILEOPEN = 7
STD_FILESAVE = 8
STD_PRINTPRE = 9
STD_PROPERTIES = 10
STD_HELP = 11
STD_FIND = 12
STD_REPLACE = 13
STD_PRINT = 14

VIEW_LARGEICONS = 0
VIEW_SMALLICONS = 1
VIEW_LIST = 2
VIEW_DETAILS = 3
VIEW_SORTNAME = 4
VIEW_SORTSIZE = 5
VIEW_SORTDATE = 6
VIEW_SORTTYPE = 7
VIEW_PARENTFOLDER = 8
VIEW_NETCONNECT = 9
VIEW_NETDISCONNECT = 10
VIEW_NEWFOLDER = 11
VIEW_VIEWMENU = 12

HIST_BACK = 0
HIST_FORWARD = 1
HIST_FAVORITES = 2
HIST_ADDTOFAVORITES = 3
HIST_VIEWTREE = 4

TB_ADDBUTTONSA = (WM_USER + 20)
TB_INSERTBUTTONA = (WM_USER + 21)
TB_ADDBUTTONS = (WM_USER + 20)
TB_INSERTBUTTON = (WM_USER + 21)
TB_DELETEBUTTON = (WM_USER + 22)
TB_GETBUTTON = (WM_USER + 23)
TB_BUTTONCOUNT = (WM_USER + 24)
TB_COMMANDTOINDEX = (WM_USER + 25)

struct TBSAVEPARAMSA
       hkr dq ?
       pszSubKey dq ?
       pszValueName dq ?
ends

struct TBSAVEPARAMSW
       hkr dq ?
       pszSubKey dq ?
       pszValueName dq ?
ends

TB_SAVERESTOREA = (WM_USER + 26)
TB_SAVERESTOREW = (WM_USER + 76)
TB_CUSTOMIZE = (WM_USER + 27)
TB_ADDSTRINGA = (WM_USER + 28)
TB_ADDSTRINGW = (WM_USER + 77)
TB_GETITEMRECT = (WM_USER + 29)
TB_BUTTONSTRUCTSIZE = (WM_USER + 30)
TB_SETBUTTONSIZE = (WM_USER + 31)
TB_SETBITMAPSIZE = (WM_USER + 32)
TB_AUTOSIZE = (WM_USER + 33)
TB_GETTOOLTIPS = (WM_USER + 35)
TB_SETTOOLTIPS = (WM_USER + 36)
TB_SETPARENT = (WM_USER + 37)
TB_SETROWS = (WM_USER + 39)
TB_GETROWS = (WM_USER + 40)
TB_SETCMDID = (WM_USER + 42)
TB_CHANGEBITMAP = (WM_USER + 43)
TB_GETBITMAP = (WM_USER + 44)
TB_GETBUTTONTEXTA = (WM_USER + 45)
TB_GETBUTTONTEXTW = (WM_USER + 75)
TB_REPLACEBITMAP = (WM_USER + 46)
TB_SETINDENT = (WM_USER + 47)
TB_SETIMAGELIST = (WM_USER + 48)
TB_GETIMAGELIST = (WM_USER + 49)
TB_LOADIMAGES = (WM_USER + 50)
TB_GETRECT = (WM_USER + 51)
TB_SETHOTIMAGELIST = (WM_USER + 52)
TB_GETHOTIMAGELIST = (WM_USER + 53)
TB_SETDISABLEDIMAGELIST = (WM_USER + 54)
TB_GETDISABLEDIMAGELIST = (WM_USER + 55)
TB_SETSTYLE = (WM_USER + 56)
TB_GETSTYLE = (WM_USER + 57)
TB_GETBUTTONSIZE = (WM_USER + 58)
TB_SETBUTTONWIDTH = (WM_USER + 59)
TB_SETMAXTEXTROWS = (WM_USER + 60)
TB_GETTEXTROWS = (WM_USER + 61)
TB_GETOBJECT = (WM_USER + 62)
TB_GETHOTITEM = (WM_USER + 71)
TB_SETHOTITEM = (WM_USER + 72)
TB_SETANCHORHIGHLIGHT = (WM_USER + 73)
TB_GETANCHORHIGHLIGHT = (WM_USER + 74)
TB_MAPACCELERATORA = (WM_USER + 78)

struct TBINSERTMARK
       iButton dd ?
       dwFlags dd ?
ends

TBIMHT_AFTER = 1
TBIMHT_BACKGROUND = 2

TB_GETINSERTMARK = (WM_USER + 79)
TB_SETINSERTMARK = (WM_USER + 80)
TB_INSERTMARKHITTEST = (WM_USER + 81)
TB_MOVEBUTTON = (WM_USER + 82)
TB_GETMAXSIZE = (WM_USER + 83)
TB_SETEXTENDEDSTYLE = (WM_USER + 84)
TB_GETEXTENDEDSTYLE = (WM_USER + 85)
TB_GETPADDING = (WM_USER + 86)
TB_SETPADDING = (WM_USER + 87)
TB_SETINSERTMARKCOLOR = (WM_USER + 88)
TB_GETINSERTMARKCOLOR = (WM_USER + 89)
TB_SETCOLORSCHEME = CCM_SETCOLORSCHEME
TB_GETCOLORSCHEME = CCM_GETCOLORSCHEME
TB_SETUNICODEFORMAT = CCM_SETUNICODEFORMAT
TB_GETUNICODEFORMAT = CCM_GETUNICODEFORMAT
TB_MAPACCELERATORW = (WM_USER + 90)

struct TBREPLACEBITMAP
       hInstOld dq ?
       nIDOld dq ?
       hInstNew dq ?
       nIDNew dq ?
       nButtons dd ?,?
ends

TBBF_LARGE = 1
TB_GETBITMAPFLAGS = (WM_USER + 41)
TBIF_IMAGE = 1
TBIF_TEXT = 2
TBIF_STATE = 4
TBIF_STYLE = 8
TBIF_LPARAM = $10
TBIF_COMMAND = $20
TBIF_SIZE = $40
TBIF_BYINDEX = $80000000

struct TBBUTTONINFOA
       cbSize dd ?
       dwMask dd ?
       idCommand dd ?
       iImage dd ?
       fsState db ?
       fsStyle db ?
       cx dw ?,?,?
       lParam dq ?
       pszText dq ?
       cchText dd ?,?
ends

struct TBBUTTONINFOW
       cbSize dd ?
       dwMask dd ?
       idCommand dd ?
       iImage dd ?
       fsState db ?
       fsStyle db ?
       cx dw ?,?,?
       lParam dq ?
       pszText dq ?
       cchText dd ?,?
ends

TB_GETBUTTONINFOW = (WM_USER + 63)
TB_SETBUTTONINFOW = (WM_USER + 64)
TB_GETBUTTONINFOA = (WM_USER + 65)
TB_SETBUTTONINFOA = (WM_USER + 66)
TB_INSERTBUTTONW = (WM_USER + 67)
TB_ADDBUTTONSW = (WM_USER + 68)
TB_HITTEST = (WM_USER + 69)
TB_SETDRAWTEXTFLAGS = (WM_USER + 70)
TB_GETSTRINGW = (WM_USER + 91)
TB_GETSTRINGA = (WM_USER + 92)

TBMF_PAD = 1
TBMF_BARPAD = 2
TBMF_BUTTONSPACING = 4

struct TBMETRICS
       cbSize dd ?
       dwMask dd ?
       cxPad dd ?
       cyPad dd ?
       cxBarPad dd ?
       cyBarPad dd ?
       cxButtonSpacing dd ?
       cyButtonSpacing dd ?
ends

TB_GETMETRICS = (WM_USER + 101)
TB_SETMETRICS = (WM_USER + 102)
TB_SETWINDOWTHEME = CCM_SETWINDOWTHEME

TBN_GETBUTTONINFOA = (TBN_FIRST-0)
TBN_BEGINDRAG = (TBN_FIRST-1)
TBN_ENDDRAG = (TBN_FIRST-2)
TBN_BEGINADJUST = (TBN_FIRST-3)
TBN_ENDADJUST = (TBN_FIRST-4)
TBN_RESET = (TBN_FIRST-5)
TBN_QUERYINSERT = (TBN_FIRST-6)
TBN_QUERYDELETE = (TBN_FIRST-7)
TBN_TOOLBARCHANGE = (TBN_FIRST-8)
TBN_CUSTHELP = (TBN_FIRST-9)
TBN_DROPDOWN = (TBN_FIRST - 10)
TBN_GETOBJECT = (TBN_FIRST - 12)

struct NMTBHOTITEM
       hdr NMHDR
       idOld dd ?
       idNew dd ?
       dwFlags dd ?,?
ends

HICF_OTHER = 0
HICF_MOUSE = 1
HICF_ARROWKEYS = 2
HICF_ACCELERATOR = 4
HICF_DUPACCEL = 8
HICF_ENTERING = $10
HICF_LEAVING = $20
HICF_RESELECT = $40
HICF_LMOUSE = $80
HICF_TOGGLEDROPDOWN = $100

TBN_HOTITEMCHANGE = (TBN_FIRST - 13)
TBN_DRAGOUT = (TBN_FIRST - 14)
TBN_DELETINGBUTTON = (TBN_FIRST - 15)
TBN_GETDISPINFOA = (TBN_FIRST - 16)
TBN_GETDISPINFOW = (TBN_FIRST - 17)
TBN_GETINFOTIPA = (TBN_FIRST - 18)
TBN_GETINFOTIPW = (TBN_FIRST - 19)
TBN_GETBUTTONINFOW = (TBN_FIRST - 20)
TBN_RESTORE = (TBN_FIRST - 21)
TBN_SAVE = (TBN_FIRST - 22)
TBN_INITCUSTOMIZE = (TBN_FIRST - 23)
TBNRF_HIDEHELP = 1
TBNRF_ENDCUSTOMIZE = 2

struct NMTBSAVE
       hdr NMHDR
       pData dq ?
       pCurrent dq ?
       cbData dd ?
       iItem dd ?
       cButtons dd ?,?
       tbButton TBBUTTON
ends

struct NMTBRESTORE
       hdr NMHDR
       pData dq ?
       pCurrent dq ?
       cbData dd ?
       iItem dd ?
       cButtons dd ?
       cbBytesPerRecord dd ?
       tbButton TBBUTTON
ends

struct NMTBGETINFOTIPA
       hdr NMHDR
       pszText dq ?
       cchTextMax dd ?
       iItem dd ?
       lParam dq ?
ends

struct NMTBGETINFOTIPW
       hdr NMHDR
       pszText dq ?
       cchTextMax dd ?
       iItem dd ?
       lParam dq ?
ends

TBNF_IMAGE = 1
TBNF_TEXT = 2
TBNF_DI_SETITEM = $10000000

struct NMTBDISPINFOA
       hdr NMHDR
       dwMask dd ?
       idCommand dd ?
       lParam dq ?
       iImage dd ?,?
       pszText dq ?
       cchText dd ?,?
ends

struct NMTBDISPINFOW
       hdr NMHDR
       dwMask dd ?
       idCommand dd ?
       lParam dq ?
       iImage dd ?,?
       pszText dq ?
       cchText dd ?,?
ends

TBDDRET_DEFAULT = 0
TBDDRET_NODEFAULT = 1
TBDDRET_TREATPRESSED = 2

struct NMTOOLBARA
       hdr NMHDR
       iItem dd ?,?
       tbButton TBBUTTON
       cchText dd ?,?
       pszText dq ?
       rcButton RECT
ends

struct NMTOOLBARW
       hdr NMHDR
       iItem dd ?,?
       tbButton TBBUTTON
       cchText dd ?,?
       pszText dq ?
       rcButton RECT
ends

REBARCLASSNAMEW equ "ReBarWindow32"
REBARCLASSNAMEA equ "ReBarWindow32"
REBARCLASSNAME equ "ReBarWindow"

RBIM_IMAGELIST = 1

RBS_TOOLTIPS = $100
RBS_VARHEIGHT = $200
RBS_BANDBORDERS = $400
RBS_FIXEDORDER = $800
RBS_REGISTERDROP = $1000
RBS_AUTOSIZE = $2000
RBS_VERTICALGRIPPER = $4000
RBS_DBLCLKTOGGLE = $8000

struct REBARINFO
       cbSize dd ?
       fMask dd ?
       himl dq ?
ends

RBBS_BREAK = 1
RBBS_FIXEDSIZE = 2
RBBS_CHILDEDGE = 4
RBBS_HIDDEN = 8
RBBS_NOVERT = $10
RBBS_FIXEDBMP = $20
RBBS_VARIABLEHEIGHT = $40
RBBS_GRIPPERALWAYS = $80
RBBS_NOGRIPPER = $100
RBBS_USECHEVRON = $200
RBBS_HIDETITLE = $400
RBBS_TOPALIGN = $800

RBBIM_STYLE = 1
RBBIM_COLORS = 2
RBBIM_TEXT = 4
RBBIM_IMAGE = 8
RBBIM_CHILD = $10
RBBIM_CHILDSIZE = $20
RBBIM_SIZE = $40
RBBIM_BACKGROUND = $80
RBBIM_ID = $100
RBBIM_IDEALSIZE = $200
RBBIM_LPARAM = $400
RBBIM_HEADERSIZE = $800

struct REBARBANDINFOA
       cbSize dd ?
       fMask dd ?
       fStyle dd ?
       clrFore dd ?
       clrBack dd ?,?
       lpText dq ?
       cch dd ?
       iImage dd ?
       hwndChild dq ?
       cxMinChild dd ?
       cyMinChild dd ?
       cx dd ?,?
       hbmBack dq ?
       wID dd ?
       cyChild dd ?
       cyMaxChild dd ?
       cyIntegral dd ?
       cxIdeal dd ?,?
       lParam dq ?
       cxHeader dd ?
       rcChevronLocation RECT
       uChevronState dd ?
ends

struct REBARBANDINFOW
       cbSize dd ?
       fMask dd ?
       fStyle dd ?
       clrFore dd ?
       clrBack dd ?,?
       lpText dq ?
       cch dd ?
       iImage dd ?
       hwndChild dq ?
       cxMinChild dd ?
       cyMinChild dd ?
       cx dd ?,?
       hbmBack dq ?
       wID dd ?
       cyChild dd ?
       cyMaxChild dd ?
       cyIntegral dd ?
       cxIdeal dd ?,?
       lParam dq ?
       cxHeader dd ?
       rcChevronLocation RECT
       uChevronState dd ?
ends

RB_INSERTBANDA = (WM_USER +  1)
RB_DELETEBAND = (WM_USER +  2)
RB_GETBARINFO = (WM_USER +  3)
RB_SETBARINFO = (WM_USER +  4)
RB_GETBANDINFO = (WM_USER +  5)
RB_SETBANDINFOA = (WM_USER +  6)
RB_SETPARENT = (WM_USER +  7)
RB_HITTEST = (WM_USER +  8)
RB_GETRECT = (WM_USER +  9)
RB_INSERTBANDW = (WM_USER +  10)
RB_SETBANDINFOW = (WM_USER +  11)
RB_GETBANDCOUNT = (WM_USER +  12)
RB_GETROWCOUNT = (WM_USER +  13)
RB_GETROWHEIGHT = (WM_USER +  14)
RB_IDTOINDEX = (WM_USER +  16)
RB_GETTOOLTIPS = (WM_USER +  17)
RB_SETTOOLTIPS = (WM_USER +  18)
RB_SETBKCOLOR = (WM_USER +  19)
RB_GETBKCOLOR = (WM_USER +  20)
RB_SETTEXTCOLOR = (WM_USER +  21)
RB_GETTEXTCOLOR = (WM_USER +  22)
RBSTR_CHANGERECT = 1
RB_SIZETORECT = (WM_USER +  23)
RB_SETCOLORSCHEME = CCM_SETCOLORSCHEME
RB_GETCOLORSCHEME = CCM_GETCOLORSCHEME
RB_BEGINDRAG = (WM_USER + 24)
RB_ENDDRAG = (WM_USER + 25)
RB_DRAGMOVE = (WM_USER + 26)
RB_GETBARHEIGHT = (WM_USER + 27)
RB_GETBANDINFOW = (WM_USER + 28)
RB_GETBANDINFOA = (WM_USER + 29)
RB_MINIMIZEBAND = (WM_USER + 30)
RB_MAXIMIZEBAND = (WM_USER + 31)
RB_GETDROPTARGET = (CCM_GETDROPTARGET)
RB_GETBANDBORDERS = (WM_USER + 34)
RB_SHOWBAND = (WM_USER + 35)
RB_SETPALETTE = (WM_USER + 37)
RB_GETPALETTE = (WM_USER + 38)
RB_MOVEBAND = (WM_USER + 39)
RB_SETUNICODEFORMAT = CCM_SETUNICODEFORMAT
RB_GETUNICODEFORMAT = CCM_GETUNICODEFORMAT
RB_GETBANDMARGINS = (WM_USER + 40)
RB_SETWINDOWTHEME = CCM_SETWINDOWTHEME
RB_PUSHCHEVRON = (WM_USER + 43)

RBN_HEIGHTCHANGE = (RBN_FIRST - 0)
RBN_GETOBJECT = (RBN_FIRST - 1)
RBN_LAYOUTCHANGED = (RBN_FIRST - 2)
RBN_AUTOSIZE = (RBN_FIRST - 3)
RBN_BEGINDRAG = (RBN_FIRST - 4)
RBN_ENDDRAG = (RBN_FIRST - 5)
RBN_DELETINGBAND = (RBN_FIRST - 6)
RBN_DELETEDBAND = (RBN_FIRST - 7)
RBN_CHILDSIZE = (RBN_FIRST - 8)
RBN_CHEVRONPUSHED = (RBN_FIRST - 10)
RBN_MINMAX = (RBN_FIRST - 21)
RBN_AUTOBREAK = (RBN_FIRST - 22)

struct NMREBARCHILDSIZE
       hdr NMHDR
       uBand dd ?
       wID dd ?
       rcChild RECT
       rcBand RECT
ends

struct NMREBAR
       hdr NMHDR
       dwMask dd ?
       uBand dd ?
       fStyle dd ?
       wID dd ?
       lParam dq ?
ends

RBNM_ID = 1
RBNM_STYLE = 2
RBNM_LPARAM = 4

struct NMRBAUTOSIZE
       hdr NMHDR
       fChanged dd ?
       rcTarget RECT
       rcActual RECT
       pad1 dd ?
ends

struct NMREBARCHEVRON
       hdr NMHDR
       uBand dd ?
       wID dd ?
       lParam dq ?
       rc RECT
       lParamNM dq ?
ends

RBAB_AUTOSIZE = 1
RBAB_ADDBAND = 2

struct NMREBARAUTOBREAK
       hdr NMHDR
       uBand dd ?
       wID dd ?
       lParam dq ?
       uMsg dd ?
       fStyleCurrent dd ?
       fAutoBreak dd ?,?
ends

RBHT_NOWHERE = 1
RBHT_CAPTION = 2
RBHT_CLIENT = 3
RBHT_GRABBER = 4
RBHT_CHEVRON = 8

struct RBHITTESTINFO
       pt POINT
       flags dd ?
       iBand dd ?
ends

TOOLTIPS_CLASSW equ "tooltips_class32"
TOOLTIPS_CLASSA equ "tooltips_class32"
TOOLTIPS_CLASS equ "tooltips_class"

struct TTTOOLINFOA
       cbSize dd ?
       uFlags dd ?
       hwnd dq ?
       uId dq ?
       rect RECT
       hinst dq ?
       lpszText dq ?
       lParam dq ?
       lpReserved dq ?
ends

struct TTTOOLINFOW
       cbSize dd ?
       uFlags dd ?
       hwnd dq ?
       uId dq ?
       rect RECT
       hinst dq ?
       lpszText dq ?
       lParam dq ?
       lpReserved dq ?
ends

TTS_ALWAYSTIP = 1
TTS_NOPREFIX = 2
TTS_NOANIMATE = $10
TTS_NOFADE = $20
TTS_BALLOON = $40
TTS_CLOSE = $80

TTF_IDISHWND = 1
TTF_CENTERTIP = 2
TTF_RTLREADING = 4
TTF_SUBCLASS = $10
TTF_TRACK = $20
TTF_ABSOLUTE = $80
TTF_TRANSPARENT = $100
TTF_PARSELINKS = $1000
TTF_DI_SETITEM = $8000

TTDT_AUTOMATIC = 0
TTDT_RESHOW = 1
TTDT_AUTOPOP = 2
TTDT_INITIAL = 3

TTI_NONE = 0
TTI_INFO = 1
TTI_WARNING = 2
TTI_ERROR = 3

TTM_ACTIVATE = (WM_USER + 1)
TTM_SETDELAYTIME = (WM_USER + 3)
TTM_ADDTOOLA = (WM_USER + 4)
TTM_ADDTOOLW = (WM_USER + 50)
TTM_DELTOOLA = (WM_USER + 5)
TTM_DELTOOLW = (WM_USER + 51)
TTM_NEWTOOLRECTA = (WM_USER + 6)
TTM_NEWTOOLRECTW = (WM_USER + 52)
TTM_RELAYEVENT = (WM_USER + 7)
TTM_GETTOOLINFOA = (WM_USER + 8)
TTM_GETTOOLINFOW = (WM_USER + 53)
TTM_SETTOOLINFOA = (WM_USER + 9)
TTM_SETTOOLINFOW = (WM_USER + 54)
TTM_HITTESTA = (WM_USER +10)
TTM_HITTESTW = (WM_USER +55)
TTM_GETTEXTA = (WM_USER +11)
TTM_GETTEXTW = (WM_USER +56)
TTM_UPDATETIPTEXTA = (WM_USER +12)
TTM_UPDATETIPTEXTW = (WM_USER +57)
TTM_GETTOOLCOUNT = (WM_USER +13)
TTM_ENUMTOOLSA = (WM_USER +14)
TTM_ENUMTOOLSW = (WM_USER +58)
TTM_GETCURRENTTOOLA = (WM_USER + 15)
TTM_GETCURRENTTOOLW = (WM_USER + 59)
TTM_WINDOWFROMPOINT = (WM_USER + 16)
TTM_TRACKACTIVATE = (WM_USER + 17)
TTM_TRACKPOSITION = (WM_USER + 18)
TTM_SETTIPBKCOLOR = (WM_USER + 19)
TTM_SETTIPTEXTCOLOR = (WM_USER + 20)
TTM_GETDELAYTIME = (WM_USER + 21)
TTM_GETTIPBKCOLOR = (WM_USER + 22)
TTM_GETTIPTEXTCOLOR = (WM_USER + 23)
TTM_SETMAXTIPWIDTH = (WM_USER + 24)
TTM_GETMAXTIPWIDTH = (WM_USER + 25)
TTM_SETMARGIN = (WM_USER + 26)
TTM_GETMARGIN = (WM_USER + 27)
TTM_POP = (WM_USER + 28)
TTM_UPDATE = (WM_USER + 29)
TTM_GETBUBBLESIZE = (WM_USER + 30)
TTM_ADJUSTRECT = (WM_USER + 31)
TTM_SETTITLEA = (WM_USER + 32)
TTM_SETTITLEW = (WM_USER + 33)
TTM_POPUP = (WM_USER + 34)
TTM_GETTITLE = (WM_USER + 35)

struct TTGETTITLE
       dwSize dd ?
       uTitleBitmap dd ?
       cch dd ?,?
       pszTitle dq ?
ends

TTM_SETWINDOWTHEME = CCM_SETWINDOWTHEME

struct TTHITTESTINFOA
       hwnd dq ?
       pt POINT
       ti TTTOOLINFOA
ends

struct TTHITTESTINFOW
       hwnd dq ?
       pt POINT
       ti TTTOOLINFOW
ends

TTN_GETDISPINFOA = (TTN_FIRST - 0)
TTN_GETDISPINFOW = (TTN_FIRST - 10)
TTN_SHOW = (TTN_FIRST - 1)
TTN_POP = (TTN_FIRST - 2)
TTN_LINKCLICK = (TTN_FIRST - 3)

struct NMTTDISPINFOA
       hdr NMHDR
       lpszText dq ?
       szText db 80 dup(?)
       hinst dq ?
       uFlags dd ?,?
       lParam dq ?
ends

struct NMTTDISPINFOW
       hdr NMHDR
       lpszText dq ?
       szText du 80 dup(?)
       hinst dq ?
       uFlags dd ?,?
       lParam dq ?
ends

SBARS_SIZEGRIP = $100
SBARS_TOOLTIPS = $800

SBT_TOOLTIPS = $800

STATUSCLASSNAMEW equ "msctls_statusbar32"
STATUSCLASSNAMEA equ "msctls_statusbar32"
STATUSCLASSNAME equ "msctls_statusbar"

SB_SETTEXTA = (WM_USER+1)
SB_SETTEXTW = (WM_USER+11)
SB_GETTEXTA = (WM_USER+2)
SB_GETTEXTW = (WM_USER+13)
SB_GETTEXTLENGTHA = (WM_USER+3)
SB_GETTEXTLENGTHW = (WM_USER+12)
SB_SETPARTS = (WM_USER+4)
SB_GETPARTS = (WM_USER+6)
SB_GETBORDERS = (WM_USER+7)
SB_SETMINHEIGHT = (WM_USER+8)
SB_SIMPLE = (WM_USER+9)
SB_GETRECT = (WM_USER+10)
SB_ISSIMPLE = (WM_USER+14)
SB_SETICON = (WM_USER+15)
SB_SETTIPTEXTA = (WM_USER+16)
SB_SETTIPTEXTW = (WM_USER+17)
SB_GETTIPTEXTA = (WM_USER+18)
SB_GETTIPTEXTW = (WM_USER+19)
SB_GETICON = (WM_USER+20)
SB_SETUNICODEFORMAT = CCM_SETUNICODEFORMAT
SB_GETUNICODEFORMAT = CCM_GETUNICODEFORMAT
SBT_OWNERDRAW = $1000
SBT_NOBORDERS = $100
SBT_POPOUT = $200
SBT_RTLREADING = $400
SBT_NOTABPARSING = $800
SB_SETBKCOLOR = CCM_SETBKCOLOR
SBN_SIMPLEMODECHANGE = (SBN_FIRST - 0)
SB_SIMPLEID = $ff
MINSYSCOMMAND = SC_SIZE

TRACKBAR_CLASSA equ "msctls_trackbar32"
TRACKBAR_CLASSW equ "msctls_trackbar32"
TRACKBAR_CLASS equ "msctls_trackbar"

TBS_AUTOTICKS = 1
TBS_VERT = 2
TBS_HORZ = 0
TBS_TOP = 4
TBS_BOTTOM = 0
TBS_LEFT = 4
TBS_RIGHT = 0
TBS_BOTH = 8
TBS_NOTICKS = $10
TBS_ENABLESELRANGE = $20
TBS_FIXEDLENGTH = $40
TBS_NOTHUMB = $80
TBS_TOOLTIPS = $100
TBS_REVERSED = $200
TBS_DOWNISLEFT = $400

TBM_GETPOS = (WM_USER)
TBM_GETRANGEMIN = (WM_USER+1)
TBM_GETRANGEMAX = (WM_USER+2)
TBM_GETTIC = (WM_USER+3)
TBM_SETTIC = (WM_USER+4)
TBM_SETPOS = (WM_USER+5)
TBM_SETRANGE = (WM_USER+6)
TBM_SETRANGEMIN = (WM_USER+7)
TBM_SETRANGEMAX = (WM_USER+8)
TBM_CLEARTICS = (WM_USER+9)
TBM_SETSEL = (WM_USER+10)
TBM_SETSELSTART = (WM_USER+11)
TBM_SETSELEND = (WM_USER+12)
TBM_GETPTICS = (WM_USER+14)
TBM_GETTICPOS = (WM_USER+15)
TBM_GETNUMTICS = (WM_USER+16)
TBM_GETSELSTART = (WM_USER+17)
TBM_GETSELEND = (WM_USER+18)
TBM_CLEARSEL = (WM_USER+19)
TBM_SETTICFREQ = (WM_USER+20)
TBM_SETPAGESIZE = (WM_USER+21)
TBM_GETPAGESIZE = (WM_USER+22)
TBM_SETLINESIZE = (WM_USER+23)
TBM_GETLINESIZE = (WM_USER+24)
TBM_GETTHUMBRECT = (WM_USER+25)
TBM_GETCHANNELRECT = (WM_USER+26)
TBM_SETTHUMBLENGTH = (WM_USER+27)
TBM_GETTHUMBLENGTH = (WM_USER+28)
TBM_SETTOOLTIPS = (WM_USER+29)
TBM_GETTOOLTIPS = (WM_USER+30)
TBM_SETTIPSIDE = (WM_USER+31)

TBTS_TOP = 0
TBTS_LEFT = 1
TBTS_BOTTOM = 2
TBTS_RIGHT = 3

TBM_SETBUDDY = (WM_USER+32)
TBM_GETBUDDY = (WM_USER+33)
TBM_SETUNICODEFORMAT = CCM_SETUNICODEFORMAT
TBM_GETUNICODEFORMAT = CCM_GETUNICODEFORMAT

TB_LINEUP = 0
TB_LINEDOWN = 1
TB_PAGEUP = 2
TB_PAGEDOWN = 3
TB_THUMBPOSITION = 4
TB_THUMBTRACK = 5
TB_TOP = 6
TB_BOTTOM = 7
TB_ENDTRACK = 8

TBCD_TICS = 1
TBCD_THUMB = 2
TBCD_CHANNEL = 3

struct TRBTHUMBPOSCHANGING
       hdr NMHDR
       dwPos dd ?
       nReason dd ?
ends

struct DRAGLISTINFO
       uNotification dd ?,?
       hWnd dq ?
       ptCursor POINT
ends

DL_BEGINDRAG = (WM_USER+133)
DL_DRAGGING = (WM_USER+134)
DL_DROPPED = (WM_USER+135)
DL_CANCELDRAG = (WM_USER+136)
DL_CURSORSET = 0
DL_STOPCURSOR = 1
DL_COPYCURSOR = 2
DL_MOVECURSOR = 3

DRAGLISTMSGSTRING equ "commctrl_DragListMsg"

UPDOWN_CLASSA equ "msctls_updown32"
UPDOWN_CLASSW equ "msctls_updown32"
UPDOWN_CLASS equ "msctls_updown"

struct UDACCEL
       nSec dd ?
       nInc dd ?
ends

UD_MAXVAL = $7fff
UD_MINVAL = -UD_MAXVAL

UDS_WRAP = 1
UDS_SETBUDDYINT = 2
UDS_ALIGNRIGHT = 4
UDS_ALIGNLEFT = 8
UDS_AUTOBUDDY = $10
UDS_ARROWKEYS = $20
UDS_HORZ = $40
UDS_NOTHOUSANDS = $80
UDS_HOTTRACK = $100

UDM_SETRANGE = (WM_USER+101)
UDM_GETRANGE = (WM_USER+102)
UDM_SETPOS = (WM_USER+103)
UDM_GETPOS = (WM_USER+104)
UDM_SETBUDDY = (WM_USER+105)
UDM_GETBUDDY = (WM_USER+106)
UDM_SETACCEL = (WM_USER+107)
UDM_GETACCEL = (WM_USER+108)
UDM_SETBASE = (WM_USER+109)
UDM_GETBASE = (WM_USER+110)
UDM_SETRANGE32 = (WM_USER+111)
UDM_GETRANGE32 = (WM_USER+112)
UDM_SETUNICODEFORMAT = CCM_SETUNICODEFORMAT
UDM_GETUNICODEFORMAT = CCM_GETUNICODEFORMAT
UDM_SETPOS32 = (WM_USER+113)
UDM_GETPOS32 = (WM_USER+114)

struct NMUPDOWN
       hdr NMHDR
       iPos dd ?
       iDelta dd ?
ends

PROGRESS_CLASSA equ "msctls_progress32"
PROGRESS_CLASSW equ "msctls_progress32"
PROGRESS_CLASS equ "msctls_progress"

PBS_SMOOTH = 1
PBS_VERTICAL = 4

PBM_SETRANGE = (WM_USER+1)
PBM_SETPOS = (WM_USER+2)
PBM_DELTAPOS = (WM_USER+3)
PBM_SETSTEP = (WM_USER+4)
PBM_STEPIT = (WM_USER+5)
PBM_SETRANGE32 = (WM_USER+6)

struct PBRANGE
       iLow dd ?
       iHigh dd ?
ends

PBM_GETRANGE = (WM_USER+7)
PBM_GETPOS = (WM_USER+8)
PBM_SETBARCOLOR = (WM_USER+9)
PBM_SETBKCOLOR = CCM_SETBKCOLOR
PBS_MARQUEE = 8
PBM_SETMARQUEE = (WM_USER+10)

HOTKEYF_SHIFT = 1
HOTKEYF_CONTROL = 2
HOTKEYF_ALT = 4
HOTKEYF_EXT = 8

HKCOMB_NONE = 1
HKCOMB_S = 2
HKCOMB_C = 4
HKCOMB_A = 8
HKCOMB_SC = $10
HKCOMB_SA = $20
HKCOMB_CA = $40
HKCOMB_SCA  = $80

HKM_SETHOTKEY = (WM_USER+1)
HKM_GETHOTKEY = (WM_USER+2)
HKM_SETRULES = (WM_USER+3)

HOTKEY_CLASSA equ "msctls_hotkey32"
HOTKEY_CLASSW equ "msctls_hotkey32"
HOTKEY_CLASS equ "msctls_hotkey"

CCS_TOP = 1
CCS_NOMOVEY = 2
CCS_BOTTOM = 3
CCS_NORESIZE = 4
CCS_NOPARENTALIGN = 8
CCS_ADJUSTABLE = $20
CCS_NODIVIDER = $40
CCS_VERT = $80
CCS_LEFT = (CCS_VERT or CCS_TOP)
CCS_RIGHT = (CCS_VERT or CCS_BOTTOM)
CCS_NOMOVEX = (CCS_VERT or CCS_NOMOVEY)

WC_LISTVIEWA equ "SysListView32"
WC_LISTVIEWW equ "SysListView32"
WC_LISTVIEW equ "SysListView"

LVS_ICON = 0
LVS_REPORT = 1
LVS_SMALLICON = 2
LVS_LIST = 3
LVS_TYPEMASK = 3
LVS_SINGLESEL = 4
LVS_SHOWSELALWAYS = 8
LVS_SORTASCENDING = $10
LVS_SORTDESCENDING = $20
LVS_SHAREIMAGELISTS = $40
LVS_NOLABELWRAP = $80
LVS_AUTOARRANGE = $100
LVS_EDITLABELS = $200
LVS_OWNERDATA = $1000
LVS_NOSCROLL = $2000
LVS_TYPESTYLEMASK = $fc00
LVS_ALIGNTOP = 0
LVS_ALIGNLEFT = $800
LVS_ALIGNMASK = $c00
LVS_OWNERDRAWFIXED = $400
LVS_NOCOLUMNHEADER = $4000
LVS_NOSORTHEADER = $8000

LVM_SETUNICODEFORMAT = CCM_SETUNICODEFORMAT
LVM_GETUNICODEFORMAT = CCM_GETUNICODEFORMAT
LVM_GETBKCOLOR = (LVM_FIRST + 0)
LVM_SETBKCOLOR = (LVM_FIRST + 1)
LVM_GETIMAGELIST = (LVM_FIRST + 2)

LVSIL_NORMAL = 0
LVSIL_SMALL = 1
LVSIL_STATE = 2
LVM_SETIMAGELIST = (LVM_FIRST + 3)
LVM_GETITEMCOUNT = (LVM_FIRST + 4)

LVIF_TEXT = 1
LVIF_IMAGE = 2
LVIF_PARAM = 4
LVIF_STATE = 8
LVIF_INDENT = $10
LVIF_NORECOMPUTE = $800
LVIF_GROUPID = $100
LVIF_COLUMNS = $200
LVIS_FOCUSED = 1
LVIS_SELECTED = 2
LVIS_CUT = 4
LVIS_DROPHILITED = 8
LVIS_GLOW = $10
LVIS_ACTIVATING = $20

LVIS_OVERLAYMASK = $F00
LVIS_STATEIMAGEMASK = $F000

macro INDEXTOSTATEIMAGEMASK i {
      mov     eax, i << 12
}

I_GROUPIDCALLBACK = -1
I_GROUPIDNONE = -2

struct LVITEMA
       mask dd ?
       iItem dd ?
       iSubItem dd ?
       state dd ?
       stateMask dd ?
       pszText dd ?
       cchTextMax dd ?
       iImage dd ?
       lParam dq ?
       iIndent dd ?
       iGroupId dd ?
       cColumns dd ?,?
       puColumns dq ?
       piColFmt dq ?
       iGroup dd ?,?
ends

struct LVITEMW
       mask dd ?
       iItem dd ?
       iSubItem dd ?
       state dd ?
       stateMask dd ?
       pszText dd ?
       cchTextMax dd ?
       iImage dd ?
       lParam dq ?
       iIndent dd ?
       iGroupId dd ?
       cColumns dd ?,?
       puColumns dq ?
       piColFmt dq ?
       iGroup dd ?,?
ends

I_IMAGECALLBACK = -1
I_IMAGENONE = -2
I_COLUMNSCALLBACK = -1

LVM_INSERTITEMA = (LVM_FIRST + 7)
LVM_INSERTITEMW = (LVM_FIRST + 77)
LVM_DELETEITEM = (LVM_FIRST + 8)
LVM_DELETEALLITEMS = (LVM_FIRST + 9)
LVM_GETCALLBACKMASK = (LVM_FIRST + 10)
LVM_SETCALLBACKMASK = (LVM_FIRST + 11)

LVNI_ALL = 0
LVNI_FOCUSED = 1
LVNI_SELECTED = 2
LVNI_CUT = 4
LVNI_DROPHILITED = 8
LVNI_ABOVE = $100
LVNI_BELOW = $200
LVNI_TOLEFT = $400
LVNI_TORIGHT = $800

LVM_GETNEXTITEM = (LVM_FIRST + 12)

LVFI_PARAM = 1
LVFI_STRING = 2
LVFI_PARTIAL = 8
LVFI_WRAP = $20
LVFI_NEARESTXY = $40

struct LVFINDINFOA
       flags dd ?,?
       psz dq ?
       lParam dq ?
       pt POINT
       vkDirection dd ?,?
ends

struct LVFINDINFOW
       flags dd ?,?
       psz dq ?
       lParam dq ?
       pt POINT
       vkDirection dd ?,?
ends

LVM_FINDITEMA = (LVM_FIRST + 13)
LVM_FINDITEMW = (LVM_FIRST + 83)

LVIR_BOUNDS = 0
LVIR_ICON = 1
LVIR_LABEL = 2
LVIR_SELECTBOUNDS = 3

LVM_GETITEMRECT = (LVM_FIRST + 14)
LVM_SETITEMPOSITION = (LVM_FIRST + 15)
LVM_GETITEMPOSITION = (LVM_FIRST + 16)
LVM_GETSTRINGWIDTHA = (LVM_FIRST + 17)
LVM_GETSTRINGWIDTHW = (LVM_FIRST + 87)

LVHT_NOWHERE = 1
LVHT_ONITEMICON = 2
LVHT_ONITEMLABEL = 4
LVHT_ONITEMSTATEICON = 8
LVHT_ONITEM = (LVHT_ONITEMICON or LVHT_ONITEMLABEL or LVHT_ONITEMSTATEICON)

LVHT_ABOVE = 8
LVHT_BELOW = $10
LVHT_TORIGHT = $20
LVHT_TOLEFT = $40

struct LVHITTESTINFO
       pt POINT
       flags dd ?
       iItem dd ?
       iSubItem dd ?
       iGroup dd ?
ends

LVM_HITTEST = (LVM_FIRST + 18)
LVM_ENSUREVISIBLE = (LVM_FIRST + 19)
LVM_SCROLL = (LVM_FIRST + 20)
LVM_REDRAWITEMS = (LVM_FIRST + 21)

LVA_DEFAULT = 0
LVA_ALIGNLEFT = 1
LVA_ALIGNTOP = 2
LVA_SNAPTOGRID = 5
LVM_ARRANGE = (LVM_FIRST + 22)
LVM_EDITLABELA = (LVM_FIRST + 23)
LVM_EDITLABELW = (LVM_FIRST + 118)
LVM_GETEDITCONTROL = (LVM_FIRST + 24)

struct LVCOLUMNA
       mask dd ?
       fmt dd ?
       lvcx dd ?,?
       pszText dq ?
       cchTextMax dd ?
       iSubItem dd ?
       iImage dd ?
       iOrder dd ?
       cxMin dd ?
       cxDefault dd ?
       cxIdeal dd ?,?
ends

struct LVCOLUMNW
       mask dd ?
       fmt dd ?
       lvcx dd ?,?
       pszText dq ?
       cchTextMax dd ?
       iSubItem dd ?
       iImage dd ?
       iOrder dd ?
       cxMin dd ?
       cxDefault dd ?
       cxIdeal dd ?,?
ends

LVCF_FMT = 1
LVCF_WIDTH = 2
LVCF_TEXT = 4
LVCF_SUBITEM = 8
LVCF_IMAGE = $10
LVCF_ORDER = $20

LVCFMT_LEFT = 0
LVCFMT_RIGHT = 1
LVCFMT_CENTER = 2
LVCFMT_JUSTIFYMASK = 3
LVCFMT_IMAGE = $800
LVCFMT_BITMAP_ON_RIGHT = $1000
LVCFMT_COL_HAS_IMAGES = $8000

LVM_GETITEMA = LVM_FIRST + 5
LVM_GETITEMW = LVM_FIRST + 75
LVM_SETITEMA = LVM_FIRST + 6
LVM_SETITEMW = LVM_FIRST + 76
LVM_GETCOLUMNA = (LVM_FIRST + 25)
LVM_GETCOLUMNW = (LVM_FIRST + 95)
LVM_SETCOLUMNA = (LVM_FIRST + 26)
LVM_SETCOLUMNW = (LVM_FIRST + 96)
LVM_INSERTCOLUMNA = (LVM_FIRST + 27)
LVM_INSERTCOLUMNW = (LVM_FIRST + 97)
LVM_DELETECOLUMN = (LVM_FIRST + 28)
LVM_GETCOLUMNWIDTH = (LVM_FIRST + 29)

LVSCW_AUTOSIZE = -1
LVSCW_AUTOSIZE_USEHEADER = -2

LVM_SETCOLUMNWIDTH = (LVM_FIRST + 30)
LVM_GETHEADER = (LVM_FIRST + 31)
LVM_CREATEDRAGIMAGE = (LVM_FIRST + 33)
LVM_GETVIEWRECT = (LVM_FIRST + 34)
LVM_GETTEXTCOLOR = (LVM_FIRST + 35)
LVM_SETTEXTCOLOR = (LVM_FIRST + 36)
LVM_GETTEXTBKCOLOR = (LVM_FIRST + 37)
LVM_SETTEXTBKCOLOR = (LVM_FIRST + 38)
LVM_GETTOPINDEX = (LVM_FIRST + 39)
LVM_GETCOUNTPERPAGE = (LVM_FIRST + 40)
LVM_GETORIGIN = (LVM_FIRST + 41)
LVM_UPDATE = (LVM_FIRST + 42)
LVM_SETITEMSTATE = (LVM_FIRST + 43)
LVM_GETITEMSTATE = (LVM_FIRST + 44)
LVM_GETITEMTEXTA = (LVM_FIRST + 45)
LVM_GETITEMTEXTW = (LVM_FIRST + 115)
LVM_SETITEMTEXTA = (LVM_FIRST + 46)
LVM_SETITEMTEXTW = (LVM_FIRST + 116)

LVSICF_NOINVALIDATEALL	= 1
LVSICF_NOSCROLL = 2

LVM_SETITEMCOUNT = (LVM_FIRST + 47)
LVM_SORTITEMS = (LVM_FIRST + 48)
LVM_SETITEMPOSITION32 = (LVM_FIRST + 49)
LVM_GETSELECTEDCOUNT = (LVM_FIRST + 50)
LVM_GETITEMSPACING = (LVM_FIRST + 51)
LVM_GETISEARCHSTRINGA = (LVM_FIRST + 52)
LVM_GETISEARCHSTRINGW = (LVM_FIRST + 117)
LVM_SETICONSPACING = (LVM_FIRST + 53)
LVM_SETEXTENDEDLISTVIEWSTYLE = (LVM_FIRST + 54)
LVM_GETEXTENDEDLISTVIEWSTYLE = (LVM_FIRST + 55)

LVS_EX_GRIDLINES = 1
LVS_EX_SUBITEMIMAGES = 2
LVS_EX_CHECKBOXES = 4
LVS_EX_TRACKSELECT = 8
LVS_EX_HEADERDRAGDROP = $10
LVS_EX_FULLROWSELECT = $20
LVS_EX_ONECLICKACTIVATE = $40
LVS_EX_TWOCLICKACTIVATE = $80
LVS_EX_FLATSB = $100
LVS_EX_REGIONAL = $200
LVS_EX_INFOTIP = $400
LVS_EX_UNDERLINEHOT = $800
LVS_EX_UNDERLINECOLD = $1000
LVS_EX_MULTIWORKAREAS = $2000
LVS_EX_LABELTIP = $4000
LVS_EX_BORDERSELECT = $8000
LVS_EX_DOUBLEBUFFER = $10000
LVS_EX_HIDELABELS = $20000
LVS_EX_SINGLEROW = $40000
LVS_EX_SNAPTOGRID = $80000
LVS_EX_SIMPLESELECT = $100000

LVM_GETSUBITEMRECT = (LVM_FIRST + 56)
LVM_SUBITEMHITTEST = (LVM_FIRST + 57)
LVM_SETCOLUMNORDERARRAY = (LVM_FIRST + 58)
LVM_GETCOLUMNORDERARRAY = (LVM_FIRST + 59)
LVM_SETHOTITEM = (LVM_FIRST + 60)
LVM_GETHOTITEM = (LVM_FIRST + 61)
LVM_SETHOTCURSOR = (LVM_FIRST + 62)
LVM_GETHOTCURSOR = (LVM_FIRST + 63)
LVM_APPROXIMATEVIEWRECT = (LVM_FIRST + 64)
LV_MAX_WORKAREAS = 16
LVM_SETWORKAREAS = (LVM_FIRST + 65)
LVM_GETWORKAREAS = (LVM_FIRST + 70)
LVM_GETNUMBEROFWORKAREAS = (LVM_FIRST + 73)
LVM_GETSELECTIONMARK = (LVM_FIRST + 66)
LVM_SETSELECTIONMARK = (LVM_FIRST + 67)
LVM_SETHOVERTIME = (LVM_FIRST + 71)
LVM_GETHOVERTIME = (LVM_FIRST + 72)
LVM_SETTOOLTIPS = (LVM_FIRST + 74)
LVM_GETTOOLTIPS = (LVM_FIRST + 78)
LVM_SORTITEMSEX = (LVM_FIRST + 81)

if sizeof.TCHAR = 1
    LVM_GETITEM		     = LVM_GETITEMA
else
    LVM_GETITEM		     = LVM_GETITEMW
end if
if sizeof.TCHAR = 1
    LVM_SETITEM		     = LVM_SETITEMA
else
    LVM_SETITEM		     = LVM_SETITEMW
end if
if sizeof.TCHAR = 1
    LVM_INSERTITEM		     = LVM_INSERTITEMA
else
    LVM_INSERTITEM		     = LVM_INSERTITEMW
end if
if sizeof.TCHAR = 1
    LVM_FINDITEM		     = LVM_FINDITEMA
else
    LVM_FINDITEM		     = LVM_FINDITEMW
end if
if sizeof.TCHAR = 1
    LVM_GETSTRINGWIDTH	     = LVM_GETSTRINGWIDTHA
else
    LVM_GETSTRINGWIDTH	     = LVM_GETSTRINGWIDTHW
end if
if sizeof.TCHAR = 1
    LVM_GETCOLUMN		     = LVM_GETCOLUMNA
else
    LVM_GETCOLUMN		     = LVM_GETCOLUMNW
end if
if sizeof.TCHAR = 1
    LVM_SETCOLUMN		     = LVM_SETCOLUMNA
else
    LVM_SETCOLUMN		     = LVM_SETCOLUMNW
end if
if sizeof.TCHAR = 1
    LVM_INSERTCOLUMN	     = LVM_INSERTCOLUMNA
else
    LVM_INSERTCOLUMN	     = LVM_INSERTCOLUMNW
end if
if sizeof.TCHAR = 1
    LVM_GETITEMTEXT 	     = LVM_GETITEMTEXTA
else
    LVM_GETITEMTEXT 	     = LVM_GETITEMTEXTW
end if
if sizeof.TCHAR = 1
    LVM_SETITEMTEXT 	     = LVM_SETITEMTEXTA
else
    LVM_SETITEMTEXT 	     = LVM_SETITEMTEXTW
end if
if sizeof.TCHAR = 1
    LVM_SETITEMTEXT 	     = LVM_SETITEMTEXTA
else
    LVM_SETITEMTEXT 	     = LVM_SETITEMTEXTW
end if
if sizeof.TCHAR = 1
    LVM_GETISEARCHSTRING	     = LVM_GETISEARCHSTRINGA
else
    LVM_GETISEARCHSTRING	     = LVM_GETISEARCHSTRINGW
end if
if sizeof.TCHAR = 1
    LVM_EDITLABEL		     = LVM_EDITLABELA
else
    LVM_EDITLABEL		     = LVM_EDITLABELW
end if

struct LVBKIMAGEA
       ulFlags dd ?,?
       hbm dq ?
       pszImage dq ?
       cchImageMax dd ?
       xOffsetPercent dd ?
       yOffsetPercent dd ?,?
ends

struct LVBKIMAGEW
       ulFlags dd ?,?
       hbm dq ?
       pszImage dq ?
       cchImageMax dd ?
       xOffsetPercent dd ?
       yOffsetPercent dd ?,?
ends

LVBKIF_SOURCE_NONE = 0
LVBKIF_SOURCE_HBITMAP = 1
LVBKIF_SOURCE_URL = 2
LVBKIF_SOURCE_MASK = 3
LVBKIF_STYLE_NORMAL = 0
LVBKIF_STYLE_TILE = $10
LVBKIF_STYLE_MASK = $10
LVBKIF_FLAG_TILEOFFSET = $100
LVBKIF_TYPE_WATERMARK = $10000000

LVM_SETBKIMAGEA = (LVM_FIRST + 68)
LVM_SETBKIMAGEW = (LVM_FIRST + 138)
LVM_GETBKIMAGEA = (LVM_FIRST + 69)
LVM_GETBKIMAGEW = (LVM_FIRST + 139)
LVM_SETSELECTEDCOLUMN = (LVM_FIRST + 140)
LVM_SETTILEWIDTH = (LVM_FIRST + 141)

LV_VIEW_ICON = 0
LV_VIEW_DETAILS = 1
LV_VIEW_SMALLICON = 2
LV_VIEW_LIST = 3
LV_VIEW_TILE = 4
LV_VIEW_MAX = 4

LVM_SETVIEW = (LVM_FIRST + 142)
LVM_GETVIEW = (LVM_FIRST + 143)

LVGF_NONE = 0
LVGF_HEADER = 1
LVGF_FOOTER = 2
LVGF_STATE = 4
LVGF_ALIGN = 8
LVGF_GROUPID = $10

LVGS_NORMAL = 0
LVGS_COLLAPSED = 1
LVGS_HIDDEN = 2

LVGA_HEADER_LEFT = 1
LVGA_HEADER_CENTER = 2
LVGA_HEADER_RIGHT = 4
LVGA_FOOTER_LEFT = 8
LVGA_FOOTER_CENTER = $10
LVGA_FOOTER_RIGHT = $20

struct LVGROUP
       cbSize dd ?
       mask dd ?
       pszHeader dq ?
       cchHeader dd ?,?
       pszFooter dq ?
       cchFooter dd ?
       iGroupId dd ?
       stateMask dd ?
       state dd ?
       uAlign dd ?,?
       pszSubtitle dq ?
       cchSubtitle dd ?,?
       pszTask dq ?
       cchTask dd ?,?
       pszDescriptionTop dq ?
       cchDescriptionTop dd ?,?
       pszDescriptionBottom dq ?
       cchDescriptionBottom dd ?
       iTitleImage dd ?
       iExtendedImage dd ?
       iFirstItem dd ?
       cItems dd ?,?
       pszSubsetTitle dq ?
       cchSubsetTitle dd ?,?
ends

LVM_INSERTGROUP = (LVM_FIRST + 145)
LVM_SETGROUPINFO = (LVM_FIRST + 147)
LVM_GETGROUPINFO = (LVM_FIRST + 149)
LVM_REMOVEGROUP = (LVM_FIRST + 150)
LVM_MOVEGROUP = (LVM_FIRST + 151)
LVM_MOVEITEMTOGROUP = (LVM_FIRST + 154)

LVGMF_NONE = 0
LVGMF_BORDERSIZE = 1
LVGMF_BORDERCOLOR = 2
LVGMF_TEXTCOLOR = 4

struct LVGROUPMETRICS
       cbSize dd ?
       mask dd ?
       Left dd ?
       Top dd ?
       Right dd ?
       Bottom dd ?
       crLeft dd ?
       crTop dd ?
       crRight dd ?
       crBottom dd ?
       crHeader dd ?
       crFooter dd ?
ends

LVM_SETGROUPMETRICS = (LVM_FIRST + 155)
LVM_GETGROUPMETRICS = (LVM_FIRST + 156)
LVM_ENABLEGROUPVIEW = (LVM_FIRST + 157)
LVM_SORTGROUPS = (LVM_FIRST + 158)

struct LVINSERTGROUPSORTED
       pfnGroupCompare dq ?
       pvData dq ?
       lvGroup LVGROUP
ends

LVM_INSERTGROUPSORTED = (LVM_FIRST + 159)
LVM_REMOVEALLGROUPS = (LVM_FIRST + 160)
LVM_HASGROUP = (LVM_FIRST + 161)

LVTVIF_AUTOSIZE = 0
LVTVIF_FIXEDWIDTH = 1
LVTVIF_FIXEDHEIGHT = 2
LVTVIF_FIXEDSIZE = 3

LVTVIM_TILESIZE = 1
LVTVIM_COLUMNS = 2
LVTVIM_LABELMARGIN = 4

struct LVTILEVIEWINFO
       cbSize dd ?
       dwMask dd ?
       dwFlags dd ?
       sizeTile SIZE
       cLines dd ?
       rcLabelMargin RECT
ends

struct LVTILEINFO
       cbSize dd ?
       iItem dd ?
       cColumns dd ?,?
       puColumns dq ?
ends

LVM_SETTILEVIEWINFO = (LVM_FIRST + 162)
LVM_GETTILEVIEWINFO = (LVM_FIRST + 163)
LVM_SETTILEINFO = (LVM_FIRST + 164)
LVM_GETTILEINFO = (LVM_FIRST + 165)

struct LVINSERTMARK
       cbSize dd ?
       dwFlags dd ?
       iItem dd ?
       dwReserved dd ?
ends

LVIM_AFTER = 1
LVM_SETINSERTMARK = (LVM_FIRST + 166)
LVM_GETINSERTMARK = (LVM_FIRST + 167)
LVM_INSERTMARKHITTEST = (LVM_FIRST + 168)
LVM_GETINSERTMARKRECT = (LVM_FIRST + 169)
LVM_SETINSERTMARKCOLOR = (LVM_FIRST + 170)
LVM_GETINSERTMARKCOLOR = (LVM_FIRST + 171)

struct LVSETINFOTIP
       cbSize dd ?
       dwFlags dd ?
       pszText dq ?
       iItem dd ?
       iSubItem dd ?
ends

LVM_SETINFOTIP = (LVM_FIRST + 173)
LVM_GETSELECTEDCOLUMN = (LVM_FIRST + 174)
LVM_ISGROUPVIEWENABLED = (LVM_FIRST + 175)
LVM_GETOUTLINECOLOR = (LVM_FIRST + 176)
LVM_SETOUTLINECOLOR = (LVM_FIRST + 177)
LVM_CANCELEDITLABEL = (LVM_FIRST + 179)
LVM_MAPINDEXTOID = (LVM_FIRST + 180)
LVM_MAPIDTOINDEX = (LVM_FIRST + 181)

struct NMLISTVIEW
       hdr NMHDR
       iItem dd ?
       iSubItem dd ?
       uNewState dd ?
       uOldState dd ?
       uChanged dd ?
       ptAction POINT
       pad1 dd ?
       lParam dq ?
ends

struct NMITEMACTIVATE
       hdr NMHDR
       iItem dd ?
       iSubItem dd ?
       uNewState dd ?
       uOldState dd ?
       uChanged dd ?
       ptAction POINT
       pad1 dd ?
       lParam dq ?
       uKeyFlags dd ?,?
ends

LVKF_ALT = 1
LVKF_CONTROL = 2
LVKF_SHIFT = 4

struct NMLVCUSTOMDRAW
       nmcd NMCUSTOMDRAW
       clrText dd ?
       clrTextBk dd ?
       iSubItem dd ?
       dwItemType dd ?
       clrFace dd ?
       iIconEffect dd ?
       iIconPhase dd ?
       iPartId dd ?
       iStateId dd ?
       rcText RECT
       uAlign dd ?
ends

LVCDI_ITEM = 0
LVCDI_GROUP = 1
LVCDRF_NOSELECT = $10000
LVCDRF_NOGROUPFRAME = $20000

struct NMLVCACHEHINT
       hdr NMHDR
       iFrom dd ?
       iTo dd ?
ends

struct NMLVFINDITEMA
       hdr NMHDR
       iStart dd ?,?
       lvfi LVFINDINFOA
ends

struct NMLVFINDITEMW
       hdr NMHDR
       iStart dd ?,?
       lvfi LVFINDINFOW
ends

struct NMLVODSTATECHANGE
       hdr NMHDR
       iFrom dd ?
       iTo dd ?
       uNewState dd ?
       uOldState dd ?
ends

LVN_ITEMCHANGING = (LVN_FIRST-0)
LVN_ITEMCHANGED = (LVN_FIRST-1)
LVN_INSERTITEM = (LVN_FIRST-2)
LVN_DELETEITEM = (LVN_FIRST-3)
LVN_DELETEALLITEMS = (LVN_FIRST-4)
LVN_BEGINLABELEDITA = (LVN_FIRST-5)
LVN_BEGINLABELEDITW = (LVN_FIRST-75)
LVN_ENDLABELEDITA = (LVN_FIRST-6)
LVN_ENDLABELEDITW = (LVN_FIRST-76)
LVN_COLUMNCLICK = (LVN_FIRST-8)
LVN_BEGINDRAG = (LVN_FIRST-9)
LVN_BEGINRDRAG = (LVN_FIRST-11)
LVN_ODCACHEHINT = (LVN_FIRST-13)
LVN_ODFINDITEMA = (LVN_FIRST-52)
LVN_ODFINDITEMW = (LVN_FIRST-79)
LVN_ITEMACTIVATE = (LVN_FIRST-14)
LVN_ODSTATECHANGED = (LVN_FIRST-15)
LVN_HOTTRACK = (LVN_FIRST-21)
LVN_GETDISPINFOA = (LVN_FIRST-50)
LVN_GETDISPINFOW = (LVN_FIRST-77)
LVN_SETDISPINFOA = (LVN_FIRST-51)
LVN_SETDISPINFOW = (LVN_FIRST-78)

LVIF_DI_SETITEM = 1000

struct NMLVDISPINFOA
       hdr NMHDR
       item LVITEMA
ends

struct NMLVDISPINFOW
       hdr NMHDR
       item LVITEMW
ends

LVN_KEYDOWN = (LVN_FIRST-55)

struct NMLVKEYDOWN
       hdr NMHDR
       wVKey dw ?
       flags dd ?
ends

LVN_MARQUEEBEGIN = (LVN_FIRST-56)

struct NMLVGETINFOTIPA
       hdr NMHDR
       dwFlags dd ?,?
       pszText dq ?
       cchTextMax dd ?
       iItem dd ?
       iSubItem dd ?,?
       lParam dq ?
ends

struct NMLVGETINFOTIPW
       hdr NMHDR
       dwFlags dd ?,?
       pszText dq ?
       cchTextMax dd ?
       iItem dd ?
       iSubItem dd ?,?
       lParam dq ?
ends

LVGIT_UNFOLDED = 1

LVN_GETINFOTIPA = (LVN_FIRST-57)
LVN_GETINFOTIPW = (LVN_FIRST-58)

struct NMLVSCROLL
       hdr NMHDR
       dx dd ?
       dy dd ?
ends

LVN_BEGINSCROLL = (LVN_FIRST-80)
LVN_ENDSCROLL = (LVN_FIRST-81)

WC_TREEVIEWA equ "SysTreeView32"
WC_TREEVIEWW equ "SysTreeView32"
WC_TREEVIEW equ "SysTreeView"

TVS_HASBUTTONS = 1
TVS_HASLINES = 2
TVS_LINESATROOT = 4
TVS_EDITLABELS = 8
TVS_DISABLEDRAGDROP = $10
TVS_SHOWSELALWAYS = $20
TVS_RTLREADING = $40
TVS_NOTOOLTIPS = $80
TVS_CHECKBOXES = $100
TVS_TRACKSELECT = $200
TVS_SINGLEEXPAND = $400
TVS_INFOTIP = $800
TVS_FULLROWSELECT = $1000
TVS_NOSCROLL = $2000
TVS_NONEVENHEIGHT = $4000
TVS_NOHSCROLL = $8000

TVIF_TEXT = 1
TVIF_IMAGE = 2
TVIF_PARAM = 4
TVIF_STATE = 8
TVIF_HANDLE = $10
TVIF_SELECTEDIMAGE = $20
TVIF_CHILDREN = $40
TVIF_INTEGRAL = $80

TVIS_SELECTED = 2
TVIS_CUT = 4
TVIS_DROPHILITED = 8
TVIS_BOLD = $10
TVIS_EXPANDED = $20
TVIS_EXPANDEDONCE = $40
TVIS_EXPANDPARTIAL = $80
TVIS_OVERLAYMASK = $F00
TVIS_STATEIMAGEMASK = $F000
TVIS_USERMASK = $F000

I_CHILDRENCALLBACK = -1

struct TVITEMA
       mask dd ?,?
       hItem dq ?
       state dd ?
       stateMask dd ?
       pszText dq ?
       cchTextMax dd ?
       iImage dd ?
       iSelectedImage dd ?
       cChildren dd ?
       lParam dq ?
ends

struct TVITEMW
       mask dd ?,?
       hItem dq ?
       state dd ?
       stateMask dd ?
       pszText dq ?
       cchTextMax dd ?
       iImage dd ?
       iSelectedImage dd ?
       cChildren dd ?
       lParam dq ?
ends

struct TVITEMEXA
       mask dd ?,?
       hItem dq ?
       state dd ?
       stateMask dd ?
       pszText dq ?
       cchTextMax dd ?
       iImage dd ?
       iSelectedImage dd ?
       cChildren dd ?
       lParam dq ?
       iIntegral dd ?
       uStateEx dd ?
       hwnd dq ?
       iExpandedImage dd ?,?
ends

struct TVITEMEXW
       mask dd ?,?
       hItem dq ?
       state dd ?
       stateMask dd ?
       pszText dq ?
       cchTextMax dd ?
       iImage dd ?
       iSelectedImage dd ?
       cChildren dd ?
       lParam dq ?
       iIntegral dd ?
       uStateEx dd ?
       hwnd dq ?
       iExpandedImage dd ?,?
ends

TVI_ROOT = -$10000
TVI_FIRST = -$0FFFF
TVI_LAST = -$0FFFE
TVI_SORT = -$0FFFD

struct TVINSERTSTRUCTA
       hParent dq ?
       hInsertAfter dq ?
       union
	   itemex TVITEMEXA
	   item TVITEMA
       ends
ends

struct TVINSERTSTRUCTW
       hParent dq ?
       hInsertAfter dq ?
       union
	   itemex TVITEMEXW
	   item TVITEMW
       ends
ends

TVM_INSERTITEMA = (TV_FIRST + 0)
TVM_INSERTITEMW = (TV_FIRST + 50)
TVM_DELETEITEM = (TV_FIRST + 1)
TVM_EXPAND = (TV_FIRST + 2)

TVE_COLLAPSE = 1
TVE_EXPAND = 2
TVE_TOGGLE = 3
TVE_EXPANDPARTIAL = $4000
TVE_COLLAPSERESET = $8000

TVM_GETITEMRECT = (TV_FIRST + 4)
TVM_GETCOUNT = (TV_FIRST + 5)
TVM_GETINDENT = (TV_FIRST + 6)
TVM_SETINDENT = (TV_FIRST + 7)
TVM_GETIMAGELIST = (TV_FIRST + 8)

TVSIL_NORMAL = 0
TVSIL_STATE = 2

TVM_SETIMAGELIST = (TV_FIRST + 9)
TVM_GETNEXTITEM = (TV_FIRST + 10)

TVGN_ROOT = 0
TVGN_NEXT = 1
TVGN_PREVIOUS = 2
TVGN_PARENT = 3
TVGN_CHILD = 4
TVGN_FIRSTVISIBLE = 5
TVGN_NEXTVISIBLE = 6
TVGN_PREVIOUSVISIBLE = 7
TVGN_DROPHILITE = 8
TVGN_CARET = 9
TVGN_LASTVISIBLE = $A

TVSI_NOSINGLEEXPAND = $8000

TVM_SELECTITEM = (TV_FIRST + 11)
TVM_GETITEMA = (TV_FIRST + 12)
TVM_GETITEMW = (TV_FIRST + 62)
TVM_SETITEMA = (TV_FIRST + 13)
TVM_SETITEMW = (TV_FIRST + 63)
TVM_EDITLABELA = (TV_FIRST + 14)
TVM_EDITLABELW = (TV_FIRST + 65)
TVM_GETEDITCONTROL = (TV_FIRST + 15)
TVM_GETVISIBLECOUNT = (TV_FIRST + 16)
TVM_HITTEST = (TV_FIRST + 17)

struct TVHITTESTINFO
       pt POINT
       flags dd ?,?
       hItem dq ?
ends

TVHT_NOWHERE = 1
TVHT_ONITEMICON = 2
TVHT_ONITEMLABEL = 4
TVHT_ONITEM = (TVHT_ONITEMICON or TVHT_ONITEMLABEL or TVHT_ONITEMSTATEICON)
TVHT_ONITEMINDENT = 8
TVHT_ONITEMBUTTON = $10
TVHT_ONITEMRIGHT = $20
TVHT_ONITEMSTATEICON = $40
TVHT_ABOVE = $100
TVHT_BELOW = $200
TVHT_TORIGHT = $400
TVHT_TOLEFT = $800

TVM_CREATEDRAGIMAGE = (TV_FIRST + 18)
TVM_SORTCHILDREN = (TV_FIRST + 19)
TVM_ENSUREVISIBLE = (TV_FIRST + 20)
TVM_SORTCHILDRENCB = (TV_FIRST + 21)
TVM_ENDEDITLABELNOW = (TV_FIRST + 22)
TVM_GETISEARCHSTRINGA = (TV_FIRST + 23)
TVM_GETISEARCHSTRINGW = (TV_FIRST + 64)
TVM_SETTOOLTIPS = (TV_FIRST + 24)
TVM_GETTOOLTIPS = (TV_FIRST + 25)
TVM_SETINSERTMARK = (TV_FIRST + 26)
TVM_SETUNICODEFORMAT = CCM_SETUNICODEFORMAT
TVM_GETUNICODEFORMAT = CCM_GETUNICODEFORMAT
TVM_SETITEMHEIGHT = (TV_FIRST + 27)
TVM_GETITEMHEIGHT = (TV_FIRST + 28)
TVM_SETBKCOLOR = (TV_FIRST + 29)
TVM_SETTEXTCOLOR = (TV_FIRST + 30)
TVM_GETBKCOLOR = (TV_FIRST + 31)
TVM_GETTEXTCOLOR = (TV_FIRST + 32)
TVM_SETSCROLLTIME = (TV_FIRST + 33)
TVM_GETSCROLLTIME = (TV_FIRST + 34)
TVM_SETINSERTMARKCOLOR = (TV_FIRST + 37)
TVM_GETINSERTMARKCOLOR = (TV_FIRST + 38)
TVM_GETITEMSTATE = (TV_FIRST + 39)
TVM_SETLINECOLOR = (TV_FIRST + 40)
TVM_GETLINECOLOR = (TV_FIRST + 41)
TVM_MAPACCIDTOHTREEITEM = (TV_FIRST + 42)
TVM_MAPHTREEITEMTOACCID = (TV_FIRST + 43)

struct TVSORTCB
       hParent dq ?
       lpfnCompare dq ?
       lParam dq ?
ends

struct NMTREEVIEWA
       hdr NMHDR
       action dd ?,?
       itemOld TVITEMA
       itemNew TVITEMA
       ptDrag POINT
ends

struct NMTREEVIEWW
       hdr NMHDR
       action dd ?,?
       itemOld TVITEMW
       itemNew TVITEMW
       ptDrag POINT
ends

TVN_SELCHANGINGA = (TVN_FIRST-1)
TVN_SELCHANGINGW = (TVN_FIRST-50)
TVN_SELCHANGEDA = (TVN_FIRST-2)
TVN_SELCHANGEDW = (TVN_FIRST-51)

TVC_UNKNOWN = 0
TVC_BYMOUSE = 1
TVC_BYKEYBOARD = 2

TVN_GETDISPINFOA = (TVN_FIRST-3)
TVN_GETDISPINFOW = (TVN_FIRST-52)
TVN_SETDISPINFOA = (TVN_FIRST-4)
TVN_SETDISPINFOW = (TVN_FIRST-53)

TVIF_DI_SETITEM = $1000

struct TVDISPINFOA
       hdr NMHDR
       item TVITEMA
ends

struct TVDISPINFOW
       hdr NMHDR
       item TVITEMW
ends

TVN_ITEMEXPANDINGA = (TVN_FIRST-5)
TVN_ITEMEXPANDINGW = (TVN_FIRST-54)
TVN_ITEMEXPANDEDA = (TVN_FIRST-6)
TVN_ITEMEXPANDEDW = (TVN_FIRST-55)
TVN_BEGINDRAGA = (TVN_FIRST-7)
TVN_BEGINDRAGW = (TVN_FIRST-56)
TVN_BEGINRDRAGA = (TVN_FIRST-8)
TVN_BEGINRDRAGW = (TVN_FIRST-57)
TVN_DELETEITEMA = (TVN_FIRST-9)
TVN_DELETEITEMW = (TVN_FIRST-58)
TVN_BEGINLABELEDITA = (TVN_FIRST-10)
TVN_BEGINLABELEDITW = (TVN_FIRST-59)
TVN_ENDLABELEDITA = (TVN_FIRST-11)
TVN_ENDLABELEDITW = (TVN_FIRST-60)
TVN_KEYDOWN = (TVN_FIRST-12)
TVN_GETINFOTIPA = (TVN_FIRST-13)
TVN_GETINFOTIPW = (TVN_FIRST-14)
TVN_SINGLEEXPAND = (TVN_FIRST-15)

TVNRET_DEFAULT = 0
TVNRET_SKIPOLD = 1
TVNRET_SKIPNEW = 2

struct NMTVKEYDOWN
       hdr NMHDR
       wVKey dw ?
       flags dd ?
ends

struct NMTVCUSTOMDRAW
       nmcd NMCUSTOMDRAW
       clrText dd ?
       clrTextBk dd ?
       iLevel dd ?,?
ends

struct NMTVGETINFOTIPA
       hdr NMHDR
       pszText dq ?
       cchTextMax dd ?,?
       hItem dq ?
       lParam dq ?
ends

struct NMTVGETINFOTIPW
       hdr NMHDR
       pszText dq ?
       cchTextMax dd ?,?
       hItem dq ?
       lParam dq ?
ends

TVCDRF_NOIMAGES = $10000
WC_COMBOBOXEXW equ "ComboBoxEx32"
WC_COMBOBOXEXA equ "ComboBoxEx32"

CBEIF_TEXT = 1
CBEIF_IMAGE = 2
CBEIF_SELECTEDIMAGE = 4
CBEIF_OVERLAY = 8
CBEIF_INDENT = $10
CBEIF_LPARAM = $20
CBEIF_DI_SETITEM = $10000000

struct COMBOBOXEXITEMA
       mask dd ?,?
       iItem dq ?
       pszText dq ?
       cchTextMax dd ?
       iImage dd ?
       iSelectedImage dd ?
       iOverlay dd ?
       iIndent dd ?,?
       lParam dq ?
ends

struct COMBOBOXEXITEMW
       mask dd ?,?
       iItem dq ?
       pszText dq ?
       cchTextMax dd ?
       iImage dd ?
       iSelectedImage dd ?
       iOverlay dd ?
       iIndent dd ?,?
       lParam dq ?
ends

CBEM_INSERTITEMA = (WM_USER + 1)
CBEM_SETIMAGELIST = (WM_USER + 2)
CBEM_GETIMAGELIST = (WM_USER + 3)
CBEM_GETITEMA = (WM_USER + 4)
CBEM_SETITEMA = (WM_USER + 5)
CBEM_DELETEITEM = CB_DELETESTRING
CBEM_GETCOMBOCONTROL = (WM_USER + 6)
CBEM_GETEDITCONTROL = (WM_USER + 7)
CBEM_SETEXSTYLE = (WM_USER + 8)
CBEM_SETEXTENDEDSTYLE = (WM_USER + 14)
CBEM_GETEXSTYLE = (WM_USER + 9)
CBEM_GETEXTENDEDSTYLE = (WM_USER + 9)
CBEM_SETUNICODEFORMAT = CCM_SETUNICODEFORMAT
CBEM_GETUNICODEFORMAT = CCM_GETUNICODEFORMAT
CBEM_HASEDITCHANGED = (WM_USER + 10)
CBEM_INSERTITEMW = (WM_USER + 11)
CBEM_SETITEMW = (WM_USER + 12)
CBEM_GETITEMW = (WM_USER + 13)
CBEM_SETWINDOWTHEME = CCM_SETWINDOWTHEME

CBES_EX_NOEDITIMAGE = 1
CBES_EX_NOEDITIMAGEINDENT = 2
CBES_EX_PATHWORDBREAKPROC = 4
CBES_EX_NOSIZELIMIT = 8
CBES_EX_CASESENSITIVE = $10

struct NMCOMBOBOXEXA
       hdr NMHDR
       ceItem COMBOBOXEXITEMA
ends

struct NMCOMBOBOXEXW
       hdr NMHDR
       ceItem COMBOBOXEXITEMW
ends

CBEN_GETDISPINFO = (CBEN_FIRST - 0)
CBEN_GETDISPINFOA = (CBEN_FIRST - 0)
CBEN_INSERTITEM = (CBEN_FIRST - 1)
CBEN_DELETEITEM = (CBEN_FIRST - 2)
CBEN_BEGINEDIT = (CBEN_FIRST - 4)
CBEN_ENDEDITA = (CBEN_FIRST - 5)
CBEN_ENDEDITW = (CBEN_FIRST - 6)
CBEN_GETDISPINFOW = (CBEN_FIRST - 7)
CBEN_DRAGBEGINA = (CBEN_FIRST - 8)
CBEN_DRAGBEGINW = (CBEN_FIRST - 9)

CBENF_KILLFOCUS = 1
CBENF_RETURN = 2
CBENF_ESCAPE = 3
CBENF_DROPDOWN = 4
CBEMAXSTRLEN = 260

struct NMCBEDRAGBEGINW
       hdr NMHDR
       iItemid dd ?
       szText du CBEMAXSTRLEN+2 dup(?)
ends

struct NMCBEDRAGBEGINA
       hdr NMHDR
       iItemid dd ?
       szText db CBEMAXSTRLEN dup(?)
ends

struct NMCBEENDEDITW
       hdr NMHDR
       fChanged dd ?
       iNewSelection dd ?
       szText dw CBEMAXSTRLEN dup(?)
       iWhy dd ?,?
ends

struct NMCBEENDEDITA
       hdr NMHDR
       fChanged dd ?
       iNewSelection dd ?
       szText db CBEMAXSTRLEN dup(?)
       iWhy dd ?
ends

WC_TABCONTROLA equ "SysTabControl32"
WC_TABCONTROLW equ "SysTabControl32"
WC_TABCONTROL equ "SysTabControl"

TCS_SCROLLOPPOSITE = 1
TCS_BOTTOM = 2
TCS_RIGHT = 2
TCS_MULTISELECT = 4
TCS_FLATBUTTONS = 8
TCS_FORCEICONLEFT = $10
TCS_FORCELABELLEFT = $20
TCS_HOTTRACK = $40
TCS_VERTICAL = $80
TCS_TABS = 0
TCS_BUTTONS = $100
TCS_SINGLELINE = 0
TCS_MULTILINE = $200
TCS_RIGHTJUSTIFY = 0
TCS_FIXEDWIDTH = $400
TCS_RAGGEDRIGHT = $800
TCS_FOCUSONBUTTONDOWN = $1000
TCS_OWNERDRAWFIXED = $2000
TCS_TOOLTIPS = $4000
TCS_FOCUSNEVER = $8000

TCS_EX_FLATSEPARATORS = 1
TCS_EX_REGISTERDROP = 2

TCM_GETIMAGELIST = (TCM_FIRST + 2)
TCM_SETIMAGELIST = (TCM_FIRST + 3)
TCM_GETITEMCOUNT = (TCM_FIRST + 4)

TCIF_TEXT = 1
TCIF_IMAGE = 2
TCIF_RTLREADING = 4
TCIF_PARAM = 8
TCIF_STATE = $10
TCIS_BUTTONPRESSED = 1
TCIS_HIGHLIGHTED = 2

struct TCITEMHEADERA
       imask dd ?
       lpReserved1 dd ?
       lpReserved2 dd ?,?
       pszText dq ?
       cchTextMax dd ?
       iImage dd ?
ends

struct TCITEMHEADERW
       imask dd ?
       lpReserved1 dd ?
       lpReserved2 dd ?,?
       pszText dq ?
       cchTextMax dd ?
       iImage dd ?
ends

struct TCITEMA
       imask dd ?
       dwState dd ?
       dwStateMask dd ?,?
       pszText dq ?
       cchTextMax dd ?
       iImage dd ?
       lParam dq ?
ends

struct TCITEMW
       imask dd ?
       dwState dd ?
       dwStateMask dd ?,?
       pszText dq ?
       cchTextMax dd ?
       iImage dd ?
       lParam dq ?
ends

TCM_GETITEMA = (TCM_FIRST + 5)
TCM_GETITEMW = (TCM_FIRST + 60)
TCM_SETITEMA = (TCM_FIRST + 6)
TCM_SETITEMW = (TCM_FIRST + 61)
TCM_INSERTITEMA = (TCM_FIRST + 7)
TCM_INSERTITEMW = (TCM_FIRST + 62)
TCM_DELETEITEM = (TCM_FIRST + 8)
TCM_DELETEALLITEMS = (TCM_FIRST + 9)
TCM_GETITEMRECT = (TCM_FIRST + 10)
TCM_GETCURSEL = (TCM_FIRST + 11)
TCM_SETCURSEL = (TCM_FIRST + 12)

TCHT_NOWHERE = 1
TCHT_ONITEMICON = 2
TCHT_ONITEMLABEL = 4
TCHT_ONITEM = (TCHT_ONITEMICON or TCHT_ONITEMLABEL)

struct TCHITTESTINFO
       pt POINT
       flags dd ?
ends

TCM_HITTEST = (TCM_FIRST + 13)
TCM_SETITEMEXTRA = (TCM_FIRST + 14)
TCM_ADJUSTRECT	= (TCM_FIRST + 40)
TCM_SETITEMSIZE = (TCM_FIRST + 41)
TCM_REMOVEIMAGE = (TCM_FIRST + 42)
TCM_SETPADDING = (TCM_FIRST + 43)
TCM_GETROWCOUNT = (TCM_FIRST + 44)
TCM_GETTOOLTIPS = (TCM_FIRST + 45)
TCM_SETTOOLTIPS = (TCM_FIRST + 46)
TCM_GETCURFOCUS = (TCM_FIRST + 47)
TCM_SETCURFOCUS = (TCM_FIRST + 48)
TCM_SETMINTABWIDTH = (TCM_FIRST + 49)
TCM_DESELECTALL = (TCM_FIRST + 50)
TCM_HIGHLIGHTITEM = (TCM_FIRST + 51)
TCM_SETEXTENDEDSTYLE = (TCM_FIRST + 52)
TCM_GETEXTENDEDSTYLE = (TCM_FIRST + 53)
TCM_SETUNICODEFORMAT = CCM_SETUNICODEFORMAT
TCM_GETUNICODEFORMAT = CCM_GETUNICODEFORMAT

TCN_KEYDOWN = (TCN_FIRST - 0)

struct NMTCKEYDOWN
       hdr NMHDR
       wVKey dw ?
       flags dd ?
ends

TCN_SELCHANGE = (TCN_FIRST - 1)
TCN_SELCHANGING = (TCN_FIRST - 2)
TCN_GETOBJECT = (TCN_FIRST - 3)
TCN_FOCUSCHANGE = (TCN_FIRST - 4)

ANIMATE_CLASSW equ "SysAnimate32"
ANIMATE_CLASSA equ "SysAnimate32"

ACS_CENTER = 1
ACS_TRANSPARENT = 2
ACS_AUTOPLAY = 4
ACS_TIMER = 8

ACM_OPENA = (WM_USER+100)
ACM_OPENW = (WM_USER+103)
ACM_PLAY = (WM_USER+101)
ACM_STOP = (WM_USER+102)

ACN_START = 1
ACN_STOP = 2

MONTHCAL_CLASSW equ "SysMonthCal32"
MONTHCAL_CLASSA equ "SysMonthCal32"

MCM_FIRST = $1000
MCM_GETCURSEL = (MCM_FIRST + 1)
MCM_SETCURSEL = (MCM_FIRST + 2)
MCM_GETMAXSELCOUNT = (MCM_FIRST + 3)
MCM_SETMAXSELCOUNT = (MCM_FIRST + 4)
MCM_GETSELRANGE = (MCM_FIRST + 5)
MCM_SETSELRANGE = (MCM_FIRST + 6)
MCM_GETMONTHRANGE = (MCM_FIRST + 7)
MCM_SETDAYSTATE = (MCM_FIRST + 8)
MCM_GETMINREQRECT = (MCM_FIRST + 9)
MCM_SETCOLOR = (MCM_FIRST + 10)
MCM_GETCOLOR = (MCM_FIRST + 11)

MCSC_BACKGROUND = 0
MCSC_TEXT = 1
MCSC_TITLEBK = 2
MCSC_TITLETEXT = 3
MCSC_MONTHBK = 4
MCSC_TRAILINGTEXT = 5

MCM_SETTODAY = (MCM_FIRST + 12)
MCM_GETTODAY = (MCM_FIRST + 13)
MCM_HITTEST = (MCM_FIRST + 14)

struct MCHITTESTINFO
       cbSize dd ?
       pt POINT
       uHit dd ?
       st SYSTEMTIME
       rc RECT
       iOffset dd ?
       iRow dd ?
       iCol dd ?
ends

MCHT_TITLE = $10000
MCHT_CALENDAR = $20000
MCHT_TODAYLINK = $30000
MCHT_NEXT = $1000000
MCHT_PREV = $2000000
MCHT_NOWHERE = 0
MCHT_TITLEBK = (MCHT_TITLE)
MCHT_TITLEMONTH = (MCHT_TITLE or 1)
MCHT_TITLEYEAR = (MCHT_TITLE or 2)
MCHT_TITLEBTNNEXT = (MCHT_TITLE or MCHT_NEXT or 3)
MCHT_TITLEBTNPREV = (MCHT_TITLE or MCHT_PREV or 3)
MCHT_CALENDARBK = (MCHT_CALENDAR)
MCHT_CALENDARDATE = (MCHT_CALENDAR or 1)
MCHT_CALENDARDATENEXT = (MCHT_CALENDARDATE or MCHT_NEXT)
MCHT_CALENDARDATEPREV = (MCHT_CALENDARDATE or MCHT_PREV)
MCHT_CALENDARDAY = (MCHT_CALENDAR or 2)
MCHT_CALENDARWEEKNUM = (MCHT_CALENDAR or 3)

MCM_SETFIRSTDAYOFWEEK = (MCM_FIRST + 15)
MCM_GETFIRSTDAYOFWEEK = (MCM_FIRST + 16)
MCM_GETRANGE = (MCM_FIRST + 17)
MCM_SETRANGE = (MCM_FIRST + 18)
MCM_GETMONTHDELTA = (MCM_FIRST + 19)
MCM_SETMONTHDELTA = (MCM_FIRST + 20)
MCM_GETMAXTODAYWIDTH = (MCM_FIRST + 21)
MCM_SETUNICODEFORMAT = CCM_SETUNICODEFORMAT
MCM_GETUNICODEFORMAT = CCM_GETUNICODEFORMAT

struct NMSELCHANGE
       nmhdr NMHDR
       stSelStart SYSTEMTIME
       stSelEnd SYSTEMTIME
ends

MCN_SELCHANGE = (MCN_FIRST + 1)

struct NMDAYSTATE
       nmhdr NMHDR
       stStart SYSTEMTIME
       cDayState dd ?,?
       prgDayState dq ?
ends

struct NMVIEWCHANGE
       nmhdr NMHDR
       dwOldView dd ?
       dwNewView dd ?
ends

MCN_VIEWCHANGE = (MCN_FIRST - 4)

MCN_GETDAYSTATE = (MCN_FIRST + 3)
MCN_SELECT = (MCN_FIRST + 4)

MCS_DAYSTATE = 1
MCS_MULTISELECT = 2
MCS_WEEKNUMBERS = 4
MCS_NOTODAYCIRCLE = 8
MCS_NOTODAY = $10

GMR_VISIBLE = 0
GMR_DAYSTATE = 1

DATETIMEPICK_CLASSW equ "SysDateTimePick32"
DATETIMEPICK_CLASSA equ "SysDateTimePick32"

DTM_FIRST = $1000
DTM_GETSYSTEMTIME = (DTM_FIRST + 1)
DTM_SETSYSTEMTIME = (DTM_FIRST + 2)
DTM_GETRANGE = (DTM_FIRST + 3)
DTM_SETRANGE = (DTM_FIRST + 4)
DTM_SETFORMATA = (DTM_FIRST + 5)
DTM_SETFORMATW = (DTM_FIRST + 50)
DTM_SETMCCOLOR = (DTM_FIRST + 6)
DTM_GETMCCOLOR = (DTM_FIRST + 7)
DTM_GETMONTHCAL = (DTM_FIRST + 8)
DTM_SETMCFONT = (DTM_FIRST + 9)
DTM_GETMCFONT = (DTM_FIRST + 10)

DTS_UPDOWN = 1
DTS_SHOWNONE = 2
DTS_SHORTDATEFORMAT = 0
DTS_LONGDATEFORMAT = 4
DTS_SHORTDATECENTURYFORMAT = $C
DTS_TIMEFORMAT = 9
DTS_APPCANPARSE = 10
DTS_RIGHTALIGN = 20

DTN_DATETIMECHANGE = (DTN_FIRST + 1)

struct NMDATETIMECHANGE
       nmhdr NMHDR
       dwFlags dd ?
       st SYSTEMTIME
       dd ?
ends

DTN_USERSTRINGA = (DTN_FIRST + 2)
DTN_USERSTRINGW = (DTN_FIRST + 15)

struct NMDATETIMESTRINGA
       nmhdr NMHDR
       pszUserString dq ?
       st SYSTEMTIME
       dwFlags dd ?,?
ends

struct NMDATETIMESTRINGW
       nmhdr NMHDR
       pszUserString dq ?
       st SYSTEMTIME
       dwFlags dd ?,?
ends

DTN_WMKEYDOWNA = (DTN_FIRST + 3)
DTN_WMKEYDOWNW = (DTN_FIRST + 16)

struct NMDATETIMEWMKEYDOWNA
       nmhdr NMHDR
       nVirtKey dd ?
       pszFormat dd ?
       st SYSTEMTIME
ends

struct NMDATETIMEWMKEYDOWNW
       nmhdr NMHDR
       nVirtKey dd ?
       pszFormat dd ?
       st SYSTEMTIME
ends

DTN_FORMATA  = (DTN_FIRST + 4)
DTN_FORMATW  = (DTN_FIRST + 17)

struct NMDATETIMEFORMATA
       nmhdr NMHDR
       pszFormat dq ?
       st SYSTEMTIME
       pszDisplay dq ?
       szDisplay db 64 dup(?)
ends

struct NMDATETIMEFORMATW
       nmhdr NMHDR
       pszFormat dq ?
       st SYSTEMTIME
       pszDisplay dq ?
       szDisplay du 64 dup(?)
ends

DTN_FORMATQUERYA = (DTN_FIRST + 5)
DTN_FORMATQUERYW = (DTN_FIRST + 18)

struct NMDATETIMEFORMATQUERYA
       nmhdr NMHDR
       pszFormat dq ?
       szMax SIZE
ends

struct NMDATETIMEFORMATQUERYW
       nmhdr NMHDR
       pszFormat dq ?
       szMax SIZE
ends

DTN_DROPDOWN = (DTN_FIRST + 6)
DTN_CLOSEUP = (DTN_FIRST + 7)

GDTR_MIN = 1
GDTR_MAX = 2

GDT_ERROR = -1
GDT_VALID = 0
GDT_NONE = 1

IPM_CLEARADDRESS = (WM_USER+100)
IPM_SETADDRESS = (WM_USER+101)
IPM_GETADDRESS = (WM_USER+102)
IPM_SETRANGE = (WM_USER+103)
IPM_SETFOCUS = (WM_USER+104)
IPM_ISBLANK = (WM_USER+105)

WC_IPADDRESSW equ "SysIPAddress32"
WC_IPADDRESSA equ "SysIPAddress32"

IPN_FIELDCHANGED = (IPN_FIRST - 0)

struct NMIPADDRESS
       hdr NMHDR
       iField dd ?
       iValue dd ?
ends

macro MAKEIPRANGE low, high {
      mov     eax, (high shl 8) + low
}

macro MAKEIPADDRESS b1, b2, b3, b4 {
      mov     eax, (b1 shl 24) + (b2 shl 16) + (b3 shl 8) + b4
}

macro FIRST_IPADDRESS x {
      mov     eax, x
      shr     eax, 24
}

macro SECOND_IPADDRESS x {
      mov     eax, x
      shr     eax, 16
      and     eax, $ff
}

macro THIRD_IPADDRESS x {
      mov     eax, x
      shr     eax, 8
      and     eax, $ff
}

macro FOURTH_IPADDRESS x {
      mov     eax, x
      and     eax, $ff
}

WC_PAGESCROLLERW equ "SysPager"
WC_PAGESCROLLERA equ "SysPager"

PGS_VERT = 0
PGS_HORZ = 1
PGS_AUTOSCROLL = 2
PGS_DRAGNDROP = 4

PGF_INVISIBLE = 0
PGF_NORMAL = 1
PGF_GRAYED = 2
PGF_DEPRESSED = 4
PGF_HOT = 8

PGB_TOPORLEFT = 0
PGB_BOTTOMORRIGHT = 1
PGM_SETCHILD = (PGM_FIRST + 1)
PGM_RECALCSIZE = (PGM_FIRST + 2)
PGM_FORWARDMOUSE = (PGM_FIRST + 3)
PGM_SETBKCOLOR = (PGM_FIRST + 4)
PGM_GETBKCOLOR = (PGM_FIRST + 5)
PGM_SETBORDER = (PGM_FIRST + 6)
PGM_GETBORDER = (PGM_FIRST + 7)
PGM_SETPOS = (PGM_FIRST + 8)
PGM_GETPOS = (PGM_FIRST + 9)
PGM_SETBUTTONSIZE = (PGM_FIRST + 10)
PGM_GETBUTTONSIZE = (PGM_FIRST + 11)
PGM_GETBUTTONSTATE = (PGM_FIRST + 12)
PGM_GETDROPTARGET = CCM_GETDROPTARGET

PGN_SCROLL = (PGN_FIRST-1)

PGF_SCROLLUP = 1
PGF_SCROLLDOWN = 2
PGF_SCROLLLEFT = 4
PGF_SCROLLRIGHT = 8

PGK_SHIFT = 1
PGK_CONTROL = 2
PGK_MENU = 4

struct NMPGSCROLL
       hdr NMHDR
       fwKeys dw ?
       rcParent RECT
       iDir dd ?
       iXpos dd ?
       iYpos dd ?
       iScroll dd ?
ends

PGN_CALCSIZE = (PGN_FIRST-2)
PGF_CALCWIDTH = 1
PGF_CALCHEIGHT = 2

struct NMPGCALCSIZE
       hdr NMHDR
       dwFlag dd ?
       iWidth dd ?
       iHeight dd ?,?
ends

PGN_HOTITEMCHANGE = (PGN_FIRST-3)

struct NMPGHOTITEM
       hdr NMHDR
       idOld dd ?
       idNew dd ?
       dwFlags dd ?,?
ends

WC_NATIVEFONTCTLW equ "NativeFontCtl"
WC_NATIVEFONTCTLA equ "NativeFontCtl"

NFS_EDIT = 1
NFS_STATIC = 2
NFS_LISTCOMBO = 4
NFS_BUTTON = 8
NFS_ALL = $10
NFS_USEFONTASSOC = $20

WC_BUTTONA equ "Button"
WC_BUTTONW equ "Button"

BUTTON_IMAGELIST_ALIGN_LEFT = 0
BUTTON_IMAGELIST_ALIGN_RIGHT = 1
BUTTON_IMAGELIST_ALIGN_TOP = 2
BUTTON_IMAGELIST_ALIGN_BOTTOM = 3
BUTTON_IMAGELIST_ALIGN_CENTER = 4

struct BUTTONIMAGELIST
       himl dq ?
       margin RECT
       uAlign dd ?,?
ends

BCM_GETIDEALSIZE = (BCM_FIRST + 0x0001)
BCM_SETIMAGELIST = (BCM_FIRST + 0x0002)
BCM_GETIMAGELIST = (BCM_FIRST + 0x0003)
BCM_SETTEXTMARGIN = (BCM_FIRST + 0x0004)
BCM_GETTEXTMARGIN = (BCM_FIRST + 0x0005)

struct NMBCHOTITEM
       hdr NMHDR
       dwFlags dd ?,?
ends

BCN_HOTITEMCHANGE = (BCN_FIRST + 0x0001)

BST_HOT = $200

WC_STATICA equ "Static"
WC_STATICW equ "Static"

WC_EDITA equ "Edit"
WC_EDITW equ "Edit"

EM_SETCUEBANNER = (ECM_FIRST + 1)
EM_GETCUEBANNER = (ECM_FIRST + 2)

struct EDITBALLOONTIP
       cbStruct dd ?,?
       pszTitle dq ?
       pszText dq ?
       ttiIcon dd ?,?
ends

EM_SHOWBALLOONTIP = (ECM_FIRST + 3)
EM_HIDEBALLOONTIP = (ECM_FIRST + 4)

WC_LISTBOXA equ "ListBox"
WC_LISTBOXW equ "ListBox"
WC_COMBOBOXA equ "ComboBox"
WC_COMBOBOXW equ "ComboBox"

CB_SETMINVISIBLE = (CBM_FIRST + 1)
CB_GETMINVISIBLE = (CBM_FIRST + 2)

WC_SCROLLBARA equ "ScrollBar"
WC_SCROLLBARW equ "ScrollBar"

INVALID_LINK_INDEX = -1
MAX_LINKID_TEXT = 48
L_MAX_URL_LENGTH = 2048 + 32 + 3

WC_LINK equ "SysLink"

LWS_TRANSPARENT = 1
LWS_IGNORERETURN = 2

LIF_ITEMINDEX = 1
LIF_STATE = 2
LIF_ITEMID = 4
LIF_URL = 8

LIS_FOCUSED = 1
LIS_ENABLED = 2
LIS_VISITED = 4

struct LITEM
       mask dd ?
       iLink dd ?
       state dd ?
       stateMask dd ?
       szID du MAX_LINKID_TEXT dup(?)
       szUrl du L_MAX_URL_LENGTH+1 dup(?)
ends

struct LHITTESTINFO
       pt POINT
       item LITEM
ends

struct NMLINK
       hdr NMHDR
       item LITEM
ends

LM_HITTEST = (WM_USER+0x300)
LM_GETIDEALHEIGHT = (WM_USER+0x301)
LM_SETITEM = (WM_USER+0x302)
LM_GETITEM = (WM_USER+0x303)

DA_LAST = $7FFFFFFF
DPA_APPEND = $7fffffff
DPA_ERR = -1

DSA_APPEND = $7fffffff
DSA_ERR = -1

DPAS_SORTED = 1
DPAS_INSERTBEFORE = 2
DPAS_INSERTAFTER = 4

WM_MOUSEHOVER = $2A1
WM_MOUSELEAVE = $2A3

TME_HOVER = 1
TME_LEAVE = 2
TME_NONCLIENT = $10
TME_QUERY = $40000000
TME_CANCEL = $80000000

HOVER_DEFAULT = $FFFFFFFF

WSB_PROP_CYVSCROLL = 1
WSB_PROP_CXHSCROLL = 2
WSB_PROP_CYHSCROLL = 4
WSB_PROP_CXVSCROLL = 8
WSB_PROP_CXHTHUMB = $10
WSB_PROP_CYVTHUMB = $20
WSB_PROP_VBKGCOLOR = $40
WSB_PROP_HBKGCOLOR = $80
WSB_PROP_VSTYLE = $100
WSB_PROP_HSTYLE = $200
WSB_PROP_WINSTYLE = $400
WSB_PROP_PALETTE = $800
WSB_PROP_MASK = $FFF

FSB_FLAT_MODE = 2
FSB_ENCARTA_MODE = 1
FSB_REGULAR_MODE = 0

ISOLATION_AWARE_USE_STATIC_LIBRARY = 0
ISOLATION_AWARE_BUILD_STATIC_LIBRARY = 0


;errno.h  crtdefs.h  ctype.h  limits.h  fcntl.h  time.h  io.h  float.h  math.h  excpt.h
;direct.h  delayimp.h  locale.h  share.h  signal.h  fpieee.h  malloc.h  process.h  srv.h
;crtdbg.h  stdio.h  stdlib.h  wchar.h  penwin.h

;errno.h - system wide error numbers (set by system calls)
;          Copyright (c) Microsoft Corporation. All rights reserved.
;    Purpose:
;       This file defines the system-wide error numbers (set by
;       system calls).  Conforms to the XENIX standard.  Extended
;       for compatibility with Uniforum standard.
;       [System V]

EPERM = 1
ENOENT = 2
ESRCH = 3
EINTR = 4
EIO = 5
ENXIO = 6
E2BIG = 7
ENOEXEC = 8
EBADF = 9
ECHILD = 10
EAGAIN = 11
ENOMEM = 12
EACCES = 13
EFAULT = 14
EBUSY = 16
EEXIST = 17
EXDEV = 18
ENODEV = 19
ENOTDIR = 20
EISDIR = 21
ENFILE = 23
EMFILE = 24
ENOTTY = 25
EFBIG = 27
ENOSPC = 28
ESPIPE = 29
EROFS = 30
EMLINK = 31
EPIPE = 32
EDOM = 33
EDEADLK = 36
ENAMETOOLONG = 38
ENOLCK = 39
ENOSYS = 40
ENOTEMPTY = 41

EINVAL = 22
ERANGE = 34
EILSEQ = 42
STRUNCATE = 80

;crtdefs.h - definitions/declarations common to all CRT
;            Copyright (c) Microsoft Corporation. All rights reserved.
;            Purpose: This file has mostly defines used by the entire CRT.
_VC_ASSEMBLY_PUBLICKEYTOKEN	 equ "1fc8b3b9a1e18e3b"
_CRT_ASSEMBLY_VERSION		 equ "9.0.21022.8"
__LIBRARIES_ASSEMBLY_NAME_PREFIX equ "Microsoft.VC90"

_CRT_PACKING = 8
_ARGMAX = 100

struct LOCALTSTRUCT
       locinfo dq ?
       mbcinfo dq ?
ends

struct LC_ID
       wLanguage dw ?
       wCountry dw ?
       wCodePage dw ?
ends

struct LC_CATEGORY
       locale dq ?
       wlocale dq ?
       refcount dq ?
       wrefcount dq ?
ends

struct THREADLOCALINFO
       refcount dd ?
       lc_codepage dd ?
       lc_collate_cp dd ?
       lc_handle dd 6 dup(?) ;24
       lc_id LC_ID
	     db sizeof.LC_ID*5 dup(?) ;36
       lc_category LC_CATEGORY
		   db sizeof.LC_CATEGORY*5 dup(?) ;128
       lc_clike dd ?
       mb_cur_max dd ?
       lconv_intl_refcount dq ?
       lconv_num_refcount dq ?
       lconv_mon_refcount dq ?
       lconv dq ?
       ctype1_refcount dq ?
       ctype1 dq ?
       pctype dq ?
       pclmap dq ?
       pcumap dq ?
       lc_time_curr dq ?
ends

;ctype.h - character conversion macros and ctype macros
;          Copyright (c) Microsoft Corporation. All rights reserved.
;    Purpose:
;        Defines macros for character classification/conversion.
;        [ANSI/System V]
WEOF = $FFFF

_UPPER = 1
_LOWER = 2
_DIGIT = 4
_SPACE = 8

_PUNCT = $10
_CONTROL = $20
_BLANK = $40
_HEX = $80

_LEADBYTE = $8000
_ALPHA = ($100 or _UPPER or _LOWER)

;limits.h - implementation dependent values
	    ;Copyright (c) Microsoft Corporation.  All rights reserved.
;     Purpose:
;       Contains defines for a number of implementation dependent values
;       which are commonly used in C programs.
;       [ANSI]
CHAR_BIT = 8
SCHAR_MIN = -128
SCHAR_MAX = 127
UCHAR_MAX = $ff
UCHAR_MIN = 0

MB_LEN_MAX = 5
SHRT_MIN = -32768
SHRT_MAX = 32767
USHRT_MAX = 0xffff
INT_MIN = -2147483647 - 1
INT_MAX = 2147483647
UINT_MAX = $ffffffff
LONG_MIN = -2147483647 - 1
LONG_MAX = 2147483647
ULONG_MAX = $ffffffff
LLONG_MAX = 9223372036854775807
LLONG_MIN = -9223372036854775807 - 1
ULLONG_MAX = $ffffffffffffffff

I8_MIN = -127 - 1
I8_MAX = 127
UI8_MAX = $ff

I16_MIN = -32767 - 1
I16_MAX = 32767
UI16_MAX = $ffff

I32_MIN = -2147483647 - 1
I32_MAX = 2147483647
UI32_MAX = $ffffffff

I64_MIN = -9223372036854775807 - 1
I64_MAX = 9223372036854775807
UI64_MAX = $ffffffffffffffff

;I128_MIN     -170141183460469231731687303715884105727 - 1)
;I128_MAX     170141183460469231731687303715884105727
;UI128_MAX    $ffffffffffffffffffffffffffffffff

POSIX_ARG_MAX = 4096
POSIX_CHILD_MAX = 6
POSIX_LINK_MAX = 8
POSIX_MAX_CANON = 255
POSIX_MAX_INPUT = 255
POSIX_NAME_MAX = 14
POSIX_NGROUPS_MAX = 0
POSIX_OPEN_MAX = 16
POSIX_PATH_MAX = 255
POSIX_PIPE_BUF = 512
POSIX_SSIZE_MAX = 32767
POSIX_STREAM_MAX = 8
POSIX_TZNAME_MAX = 3

ARG_MAX = 14500
LINK_MAX = 1024
MAX_CANON = POSIX_MAX_CANON
MAX_INPUT = POSIX_MAX_INPUT
NAME_MAX = 255
NGROUPS_MAX = 16
OPEN_MAX = 32
PATH_MAX = 512
PIPE_BUF = POSIX_PIPE_BUF
SSIZE_MAX = POSIX_SSIZE_MAX
STREAM_MAX = 20
TZNAME_MAX = 10

;fcntl.h - file control options used by open()
;       Copyright (c) Microsoft Corporation. All rights reserved.
;   Purpose:
;       This file defines constants for the file control options used
;       by the _open() function.
O_RDONLY = 0
O_WRONLY = 1
O_RDWR = 2
O_APPEND = 8

O_CREAT = $100
O_TRUNC = $200
O_EXCL = $400

O_TEXT = $4000
O_BINARY = $8000
O_WTEXT = $10000
O_U16TEXT = $20000
O_U8TEXT = $40000

O_RAW = O_BINARY
O_NOINHERIT = $80
O_TEMPORARY = $40
O_SHORT_LIVED = $1000
O_SEQUENTIAL = $20
O_RANDOM = $10

;time.h - definitions/declarations for time routines
;         Copyright (c) Microsoft Corporation. All rights reserved.
;   Purpose:
;       This file has declarations of time routines and defines
;       the structure returned by the localtime and gmtime routines and
;       used by asctime.
struct TM
       tm_sec dd ?
       tm_min dd ?
       tm_hour dd ?
       tm_mday dd ?
       tm_mon dd ?
       tm_year dd ?
       tm_wday dd ?
       tm_yday dd ?
       tm_isdst dd ?
ends

CLOCKS_PER_SEC = 1000
CLK_TCK = CLOCKS_PER_SEC

;io.h - declarations for low-level file handling and I/O functions
;       Copyright (c) Microsoft Corporation. All rights reserved.
;   Purpose:
;       This file contains the function declarations for the low-level
;       file handling and I/O functions.

;typedef unsigned long _fsize_t; /* Could be 64 bits for Win32 */
struct FINDDATA32T
       attrib dd ?
       time_create dd ?
       time_access dd ?
       time_write dd ?
       size dd ?
       name db 260 dup(?)
ends

struct FINDDATA32I64T
       attrib dd ?
       time_create dd ?
       time_access dd ?
       time_write dd ?
       size dq ?
       name db 260 dup(?)
       pad1 dd ?
ends

struct FINDDATA64I32T
       attrib dd ?
       pad1 dd ?
       time_create dq ?
       time_access dq ?
       time_write dq ?
       size dd ?
       name db 260 dup(?)
ends

struct FINDDATA64T
       attrib dd ?
       pad1 dd ?
       time_create dq ?
       time_access dq ?
       time_write dq ?
       size dq ?
       name db 260 dup(?)
       pad2 dd ?
ends

struct WFINDDATA32T
       attrib dd ?
       time_create dd ?
       time_access dd ?
       time_write dd ?
       size dd ?
       name du 260 dup(?)
ends

struct WFINDDATA32I64T
       attrib dd ?
       time_create dd ?
       time_access dd ?
       time_write dd ?
       size dq ?
       name du 260 dup(?)
ends

struct WFINDDATA64I32T
       attrib dd ?
       pad1 dd ?
       time_create dq ?
       time_access dq ?
       time_write dq ?
       size dd ?
       name du 260 dup(?)
       pad2 dd ?
ends

struct WFINDDATA64T
       attrib dd ?
       pad1 dd ?
       time_create dq ?
       time_access dq ?
       time_write dq ?
       size dq ?
       name du 260 dup(?)
ends

A_NORMAL = 0
A_RDONLY = 1
A_HIDDEN = 2
A_SYSTEM = 4
A_SUBDIR = $10
A_ARCH = $20

;float.h - constants for floating point values
;          Copyright (c) Microsoft Corporation. All rights reserved.
;Purpose:
;       This file contains defines for a number of implementation dependent
;       values which are commonly used by sophisticated numerical (floating
;       point) programs.
DBL_DIG 	equ 15			    ;# of decimal digits of precision */
DBL_EPSILON	equ 2.2204460492503131e-016 ;smallest such that 1.0+DBL_EPSILON != 1.0 */
DBL_MANT_DIG	equ 53			    ;# of bits in mantissa */
DBL_MAX 	equ 1.7976931348623158e+308 ;max value */
DBL_MAX_10_EXP	equ 308 		    ;max decimal exponent */
DBL_MAX_EXP	equ 1024		    ;max binary exponent */
DBL_MIN 	equ 2.2250738585072014e-308 ;min positive value */
DBL_MIN_10_EXP	equ (-307)		    ;min decimal exponent */
DBL_MIN_EXP	equ (-1021)		    ;min binary exponent */
_DBL_RADIX	equ 2			    ;exponent radix */
_DBL_ROUNDS	equ 1			    ;addition rounding: near */

FLT_DIG 	equ 6		    ;# of decimal digits of precision */
FLT_EPSILON	equ 1.192092896e-07 ;smallest such that 1.0+FLT_EPSILON != 1.0 */
FLT_GUARD	equ 0
FLT_MANT_DIG	equ 24		    ;# of bits in mantissa */
FLT_MAX 	equ 3.402823466e+38 ;max value */
FLT_MAX_10_EXP	equ 38		    ;max decimal exponent */
FLT_MAX_EXP	equ 128 	    ;max binary exponent */
FLT_MIN 	equ 1.175494351e-38 ;min positive value */
FLT_MIN_10_EXP	equ -37 	    ;min decimal exponent */
FLT_MIN_EXP	equ -125	    ;min binary exponent */
FLT_NORMALIZE	equ 0
FLT_RADIX	equ 2		    ;exponent radix */
FLT_ROUNDS	equ 1		    ;addition rounding: near */

LDBL_DIG	equ DBL_DIG	   ;# of decimal digits of precision */
LDBL_EPSILON	equ DBL_EPSILON    ;smallest such that 1.0+LDBL_EPSILON != 1.0 */
LDBL_MANT_DIG	equ DBL_MANT_DIG   ;# of bits in mantissa */
LDBL_MAX	equ DBL_MAX	   ;max value */
LDBL_MAX_10_EXP equ DBL_MAX_10_EXP ;max decimal exponent */
LDBL_MAX_EXP	equ DBL_MAX_EXP    ;max binary exponent */
LDBL_MIN	equ DBL_MIN	   ;min positive value */
LDBL_MIN_10_EXP equ DBL_MIN_10_EXP ;min decimal exponent */
LDBL_MIN_EXP	equ DBL_MIN_EXP    ;min binary exponent */
_LDBL_RADIX	equ DBL_RADIX	   ;exponent radix */
_LDBL_ROUNDS	equ DBL_ROUNDS	   ;addition rounding: near */

_SW_INEXACT = 1
_SW_UNDERFLOW = 2
_SW_OVERFLOW = 4
_SW_ZERODIVIDE = 8
_SW_INVALID = $10
_SW_DENORMAL = $80000

_EM_AMBIGUIOUS = $80000000
_EM_AMBIGUOUS = $80000000

_MCW_EM = $8001f
_EM_INEXACT = 1
_EM_UNDERFLOW = 2
_EM_OVERFLOW = 4
_EM_ZERODIVIDE = 8
_EM_INVALID = $10
_EM_DENORMAL = $80000

_MCW_RC = $300
_RC_NEAR = 0
_RC_DOWN = $100
_RC_UP = $200
_RC_CHOP = $300

_MCW_PC = $30000
_PC_64 = 0
_PC_53 = $10000
_PC_24 = $20000

_MCW_IC = $40000
_IC_AFFINE = $40000
_IC_PROJECTIVE = 0

_MCW_DN = $3000000
_DN_SAVE = 0
_DN_FLUSH = $1000000
_DN_FLUSH_OPERANDS_SAVE_RESULTS = $2000000
_DN_SAVE_OPERANDS_FLUSH_RESULTS = $3000000

_SW_UNEMULATED = $40
_SW_SQRTNEG = $80
_SW_STACKOVERFLOW = $200
_SW_STACKUNDERFLOW = $400

_FPE_INVALID = $81
_FPE_DENORMAL = $82
_FPE_ZERODIVIDE = $83
_FPE_OVERFLOW = $84
_FPE_UNDERFLOW = $85
_FPE_INEXACT = $86
_FPE_UNEMULATED = $87
_FPE_SQRTNEG = $88
_FPE_STACKOVERFLOW = $8a
_FPE_STACKUNDERFLOW = $8b
_FPE_EXPLICITGEN = $8c

_FPCLASS_SNAN = 1
_FPCLASS_QNAN = 2
_FPCLASS_NINF = 4
_FPCLASS_NN = 8
_FPCLASS_ND = $10
_FPCLASS_NZ = $20
_FPCLASS_PZ = $40
_FPCLASS_PD = $80
_FPCLASS_PN = $100
_FPCLASS_PINF = $200

DBL_RADIX     equ _DBL_RADIX
DBL_ROUNDS    equ _DBL_ROUNDS
LDBL_RADIX    equ _LDBL_RADIX
LDBL_ROUNDS   equ _LDBL_ROUNDS
EM_AMBIGUIOUS equ _EM_AMBIGUOUS 	  /* for backwards compatibility old spelling */
EM_AMBIGUOUS  equ _EM_AMBIGUOUS
MCW_EM	      equ _MCW_EM
EM_INVALID    equ _EM_INVALID
EM_DENORMAL   equ _EM_DENORMAL
EM_ZERODIVIDE equ _EM_ZERODIVIDE
EM_OVERFLOW   equ _EM_OVERFLOW
EM_UNDERFLOW  equ _EM_UNDERFLOW
EM_INEXACT    equ _EM_INEXACT
MCW_IC	      equ _MCW_IC
IC_AFFINE     equ _IC_AFFINE
IC_PROJECTIVE equ _IC_PROJECTIVE
MCW_RC	      equ _MCW_RC
RC_CHOP       equ _RC_CHOP
RC_UP	      equ _RC_UP
RC_DOWN       equ _RC_DOWN
RC_NEAR       equ _RC_NEAR
MCW_PC	      equ _MCW_PC
PC_24	      equ _PC_24
PC_53	      equ _PC_53
PC_64	      equ _PC_64

CW_DEFAULT	  equ _CW_DEFAULT

SW_INVALID	  equ _SW_INVALID
SW_DENORMAL	  equ _SW_DENORMAL
SW_ZERODIVIDE	  equ _SW_ZERODIVIDE
SW_OVERFLOW	  equ _SW_OVERFLOW
SW_UNDERFLOW	  equ _SW_UNDERFLOW
SW_INEXACT	  equ _SW_INEXACT
SW_UNEMULATED	  equ _SW_UNEMULATED
SW_SQRTNEG	  equ _SW_SQRTNEG
SW_STACKOVERFLOW  equ _SW_STACKOVERFLOW
SW_STACKUNDERFLOW equ _SW_STACKUNDERFLOW

FPE_INVALID	   equ _FPE_INVALID
FPE_DENORMAL	   equ _FPE_DENORMAL
FPE_ZERODIVIDE	   equ _FPE_ZERODIVIDE
FPE_OVERFLOW	   equ _FPE_OVERFLOW
FPE_UNDERFLOW	   equ _FPE_UNDERFLOW
FPE_INEXACT	   equ _FPE_INEXACT
FPE_UNEMULATED	   equ _FPE_UNEMULATED
FPE_SQRTNEG	   equ _FPE_SQRTNEG
FPE_STACKOVERFLOW  equ _FPE_STACKOVERFLOW
FPE_STACKUNDERFLOW equ _FPE_STACKUNDERFLOW
FPE_EXPLICITGEN    equ _FPE_EXPLICITGEN

;math.h - definitions and declarations for math library
;         Copyright (c) Microsoft Corporation. All rights reserved.
;Purpose:
;       This file contains constant definitions and external subroutine
;       declarations for the math subroutine library.
;       [ANSI/System V]
struct EXCEPTION
       type dd ?
       pad1 dd ?
       name dq ?
       arg1 dq ?
       arg2 dq ?
       retval dq ?
ends

struct COMPLEX
       x dq ?
       y dq ?
ends

_DOMAIN = 1
_SING = 2
_OVERFLOW = 3
_UNDERFLOW = 4
_TLOSS = 5
_PLOSS = 6

EDOM = 33
ERANGE = 34

HUGE_VAL equ double

DOMAIN	  equ _DOMAIN
SING	  equ _SING
OVERFLOW  equ _OVERFLOW
UNDERFLOW equ _UNDERFLOW
TLOSS	  equ _TLOSS
PLOSS	  equ _PLOSS

M_E	   equ 2.71828182845904523536	 ;e
M_LOG2E    equ 1.44269504088896340736	 ;log2(e)
M_LOG10E   equ 0.434294481903251827651	 ;log10(e)
M_LN2	   equ 0.693147180559945309417	 ;ln(2)
M_LN10	   equ 2.30258509299404568402	 ;ln(10)
M_PI	   equ 3.14159265358979323846	 ;pi
M_PI_2	   equ 1.57079632679489661923	 ;pi/2
M_PI_4	   equ 0.785398163397448309616	 ;pi/4
M_1_PI	   equ 0.318309886183790671538	 ;1/pi
M_2_PI	   equ 0.636619772367581343076	 ;2/pi
M_2_SQRTPI equ 1.12837916709551257390	 ;2/sqrt(pi)
M_SQRT2    equ 1.41421356237309504880	 ;sqrt(2)
M_SQRT1_2  equ 0.707106781186547524401	 ;1/sqrt(2)

;excpt.h - defines exception values, types and routines
;       Copyright (c) Microsoft Corporation. All rights reserved.
;Purpose:
;       This file contains the definitions and prototypes for the compiler-
;       dependent intrinsics, support functions and keywords which implement
;       the structured exception handling extensions.
ExceptionContinueExecution = 0
ExceptionContinueSearch = 1
ExceptionNestedException = 2
ExceptionCollidedUnwind = 3

EXCEPTION_EXECUTE_HANDLER = 1
EXCEPTION_CONTINUE_SEARCH = 0
EXCEPTION_CONTINUE_EXECUTION = -1

;direct.h - function declarations for directory handling/creation
;       Copyright (c) Microsoft Corporation. All rights reserved.
;Purpose:
;       This include file contains the function declarations for the library
;       functions related to directory handling and creation.
;
struct DISKFREET
       total_clusters dd ?
       avail_clusters dd ?
       sectors_per_cluster dd ?
       bytes_per_sector dd ?
ends

;DelayImp.h
;  Copyright (c) Microsoft Corporation.  All rights reserved.
;  Define structures and prototypes necessary for delay loading of imports
_DELAY_IMP_VER = 2

struct IMGDELAYDESCR
       grAttrs dd ?
       rvaDLLName dd ?
       rvaHmod dd ?
       rvaIAT dd ?
       rvaINT dd ?
       rvaBoundIAT dd ?
       rvaUnloadIAT dd ?
       dwTimeStamp dd ?
ends

dlattrRva = 1

dliStartProcessing = 0
dliNoteStartProcessing = dliStartProcessing
dliNotePreLoadLibrary = 1
dliNotePreGetProcAddress = 2
dliFailLoadLib = 3
dliFailGetProc = 4
dliNoteEndProcessing = 5

struct DelayLoadProc
       fImportByName dd ?
       pad1 dd ?
       union
	   szProcName dq ?
	   dwOrdinal dd ?
       ends
ends

struct DelayLoadInfo
       cb dd ?
       pad1 dd ?
       pidd dq ?
       ppfn dq ?
       szDll dq ?
       dlp DelayLoadProc ;16
       hmodCur dq ?
       pfnCur dq ?
       dwLastError dd ?
       pad2 dd ?
ends

FACILITY_VISUALCPP = $6d

macro VcppException sev, err {
      VALUE = (sev or (FACILITY_VISUALCPP shl 16) or err)
}

;locale.h - definitions/declarations for localization routines
;       Copyright (c) Microsoft Corporation. All rights reserved.
;Purpose:
;       This file defines the structures, values, macros, and functions
;       used by the localization routines.
LC_ALL = 0
LC_COLLATE = 1
LC_CTYPE = 2
LC_MONETARY = 3
LC_NUMERIC = 4
LC_TIME = 5
LC_MIN = LC_ALL
LC_MAX = LC_TIME

struct LCONV
       decimal_point dq ?
       thousands_sep dq ?
       grouping dq ?
       int_curr_symbol dq ?
       currency_symbol dq ?
       mon_decimal_point dq ?
       mon_thousands_sep dq ?
       mon_grouping dq ?
       positive_sign dq ?
       negative_sign dq ?
       int_frac_digits db ?
       frac_digits db ?
       p_cs_precedes db ?
       p_sep_by_space db ?
       n_cs_precedes db ?
       n_sep_by_space db ?
       p_sign_posn db ?
       n_sign_posn db ?
ends

_ENABLE_PER_THREAD_LOCALE = 1
_DISABLE_PER_THREAD_LOCALE = 2
_ENABLE_PER_THREAD_LOCALE_GLOBAL = $10
_DISABLE_PER_THREAD_LOCALE_GLOBAL = $20
_ENABLE_PER_THREAD_LOCALE_NEW = $100
_DISABLE_PER_THREAD_LOCALE_NEW = $200

;share.h - defines file sharing modes for sopen
;       Copyright (c) Microsoft Corporation. All rights reserved.
;Purpose:
;       This file defines the file sharing modes for sopen().
_SH_DENYRW = $10
_SH_DENYWR = $20
_SH_DENYRD = $30
_SH_DENYNO = $40
_SH_SECURE = $80

SH_DENYRW = _SH_DENYRW
SH_DENYWR = _SH_DENYWR
SH_DENYRD = _SH_DENYRD
SH_DENYNO = _SH_DENYNO

;signal.h - defines signal values and routines
;       Copyright (c) Microsoft Corporation. All rights reserved.
;Purpose:
;       This file defines the signal values and declares the signal functions.
NSIG = 23
SIGINT = 2
SIGILL = 4
SIGFPE = 8
SIGSEGV = 11
SIGTERM = 15
SIGBREAK = 21
SIGABRT = 22
SIGABRT_COMPAT = 6

SIG_ERR = -1
SIG_DFL = 0
SIG_IGN = 1
SIG_GET = 2
SIG_SGE = 3
SIG_ACK = 4

;fpieee.h - Definitions for floating point IEEE exception handling
;       Copyright (c) Microsoft Corporation. All rights reserved.
;Purpose:
;       This file contains constant and type definitions for handling
;       floating point exceptions [ANSI/IEEE std. 754]
_FpCompareEqual = 0
_FpCompareGreater = 1
_FpCompareLess = 2
_FpCompareUnordered = 3

_FpFormatFp32 = 0
_FpFormatFp64 = 1
_FpFormatFp80 = 2
_FpFormatFp128 = 3
_FpFormatI16 = 4
_FpFormatI32 = 5
_FpFormatI64 = 6
_FpFormatU16 = 7
_FpFormatU32 = 8
_FpFormatU64 = 9
_FpFormatBcd80 = 10
_FpFormatCompare = 11
_FpFormatString = 12
_FpFormatFp82 = 13

_FpCodeUnspecified = 0
_FpCodeAdd = 1
_FpCodeSubtract = 2
_FpCodeMultiply = 3
_FpCodeDivide = 4
_FpCodeSquareRoot = 5
_FpCodeRemainder = 6
_FpCodeCompare = 7
_FpCodeConvert = 8
_FpCodeRound = 9
_FpCodeTruncate = 10
_FpCodeFloor = 11
_FpCodeCeil = 12
_FpCodeAcos = 13
_FpCodeAsin = 14
_FpCodeAtan = 15
_FpCodeAtan2 = 16
_FpCodeCabs = 17
_FpCodeCos = 18
_FpCodeCosh = 19
_FpCodeExp = 20
_FpCodeFabs = 21
_FpCodeFmod = 22
_FpCodeFrexp = 23
_FpCodeHypot = 24
_FpCodeLdexp = 25
_FpCodeLog = 26
_FpCodeLog10 = 27
_FpCodeModf = 28
_FpCodePow = 29
_FpCodeSin = 30
_FpCodeSinh = 31
_FpCodeTan = 32
_FpCodeTanh = 33
_FpCodeY0 = 34
_FpCodeY1 = 35
_FpCodeYn = 36
_FpCodeLogb = 37
_FpCodeNextafter = 38
_FpCodeNegate = 39
_FpCodeFmin = 40
_FpCodeFmax = 41
_FpCodeConvertTrunc = 42
_XMMIAddps = 43
_XMMIAddss = 44
_XMMISubps = 45
_XMMISubss = 46
_XMMIMulps = 47
_XMMIMulss = 48
_XMMIDivps = 49
_XMMIDivss = 50
_XMMISqrtps = 51
_XMMISqrtss = 52
_XMMIMaxps = 53
_XMMIMaxss = 54
_XMMIMinps = 55
_XMMIMinss = 56
_XMMICmpps = 57
_XMMICmpss = 58
_XMMIComiss = 59
_XMMIUComiss = 60
_XMMICvtpi2ps = 61
_XMMICvtsi2ss = 62
_XMMICvtps2pi = 63
_XMMICvtss2si = 64
_XMMICvttps2pi = 65
_XMMICvttss2si = 66
_XMMIAddsubps = 67
_XMMIHaddps = 68
_XMMIHsubps = 69
_XMMIRoundps = 70
_XMMIRoundss = 71
_XMMIDpps = 72
_XMMI2Addpd = 73
_XMMI2Addsd = 74
_XMMI2Subpd = 75
_XMMI2Subsd = 76
_XMMI2Mulpd = 77
_XMMI2Mulsd = 78
_XMMI2Divpd = 79
_XMMI2Divsd = 80
_XMMI2Sqrtpd = 81
_XMMI2Sqrtsd = 82
_XMMI2Maxpd = 83
_XMMI2Maxsd = 84
_XMMI2Minpd = 85
_XMMI2Minsd = 86
_XMMI2Cmppd = 87
_XMMI2Cmpsd = 88
_XMMI2Comisd = 89
_XMMI2UComisd = 90
_XMMI2Cvtpd2pi = 91
_XMMI2Cvtsd2si = 92
_XMMI2Cvttpd2pi = 93
_XMMI2Cvttsd2si = 94
_XMMI2Cvtps2pd = 95
_XMMI2Cvtss2sd = 96
_XMMI2Cvtpd2ps = 97
_XMMI2Cvtsd2ss = 98
_XMMI2Cvtdq2ps = 99
_XMMI2Cvttps2dq = 100
_XMMI2Cvtps2dq = 101
_XMMI2Cvttpd2dq = 102
_XMMI2Cvtpd2dq = 103
_XMMI2Addsubpd = 104
_XMMI2Haddpd = 105
_XMMI2Hsubpd = 106
_XMMI2Roundpd = 107
_XMMI2Roundsd = 108
_XMMI2Dppd = 109
;IA64
_FpCodeFma = 110
_FpCodeFmaSingle = 111
_FpCodeFmaDouble = 112
_FpCodeFms = 113
_FpCodeFmsSingle = 114
_FpCodeFmsDouble = 115
_FpCodeFnma = 116
_FpCodeFnmaSingle = 117
_FpCodeFnmaDouble = 118
_FpCodeFamin = 119
_FpCodeFamax = 120

_FpRoundNearest = 0
_FpRoundMinusInfinity = 1
_FpRoundPlusInfinity = 2
_FpRoundChopped = 3

_FpPrecisionFull = 0
_FpPrecision53 = 1
_FpPrecision24 = 2
_FpPrecision64 = 3
_FpPrecision113 = 4

struct FP80
       w dw 5 dup(?)
ends

struct FP128
       W dd 4 dup(?)
ends

struct I64
       W dd ?,?
ends

struct U64
       W dd ?,?
ends

struct BCD80
       W dw 5 dup(?)
ends

struct FPQ64
       W dq ?,?
ends

struct FPIEEEVALUE
       pad1 dq ?
       union
	   Fp32Value dd ?
	   Fp64Value dq ?
	   Fp80Value FP80
	   Fp128Value FP128
	   I16Value dw ?
	   I32Value dd ?
	   I64Value dq ?
	   U16Value dw ?
	   U32Value dd ?
	   U64Value dq ?
	   Bcd80Value BCD80
	   StringValue db ?
	   CompareValue dd ?
	   Q64Value dq ?
	   Fpq64Value dq ?
       ends
       bits dd ?
       pad2 dd ?
ends

FPIEEE_VALUE_OperandValid = (1 shl 0)
FPIEEE_VALUE_Format = (1 shl 4)

FPIEEE_EXCEPTION_FLAGS_Inexact = (1 shl 0)
FPIEEE_EXCEPTION_FLAGS_Underflow = (1 shl 1)
FPIEEE_EXCEPTION_FLAGS_Overflow = (1 shl 2)
FPIEEE_EXCEPTION_FLAGS_ZeroDivide = (1 shl 3)
FPIEEE_EXCEPTION_FLAGS_InvalidOperation = (1 shl 4)

struct FPIEEERECORD
       bits dd ?
       Cause dd ?
       Enable dd ?
       Status dd ?
       Operand1 FPIEEEVALUE
       Operand2 FPIEEEVALUE
       Result FPIEEEVALUE
ends

_FPIEEE_RECORD_RoundingMode = (1 shl 2)
_FPIEEE_RECORD_Precision = (1 shl 3)
_FPIEEE_RECORD_Operation = (1 shl 12)

;malloc.h - declarations and definitions for memory allocation functions
;       Copyright (c) Microsoft Corporation. All rights reserved.
;Purpose:
;       Contains the function declarations for memory allocation functions;
;       also defines manifest constants and types used by the heap routines.
_WIN64_HEAP_MAXREQ = $FFFFFFFFFFFFFFE0
_HEAP_MAXREQ = $FFFFFFE0

_HEAPEMPTY = -1
_HEAPOK = -2
_HEAPBADBEGIN = -3
_HEAPBADNODE = -4
_HEAPEND = -5
_HEAPBADPTR = -6
_FREEENTRY = 0
_USEDENTRY = 1

struct HEAPINFO
       _pentry dq ?
       _size dq ?
       _useflag dd ?
       _pad1 dd ?
ends

_MAX_WAIT_MALLOC_CRT = 60000

_ALLOCA_S_THRESHOLD = 1024
_ALLOCA_S_STACK_MARKER = $CCCC
_ALLOCA_S_HEAP_MARKER = $DDDD

_HEAP_MALLOC = 1
_HEAP_CALLOC = 2
_HEAP_FREE = 3
_HEAP_REALLOC = 4
_HEAP_MSIZE = 5
_HEAP_EXPAND = 6

;process.h - definition and declarations for process control functions
;       Copyright (c) Microsoft Corporation. All rights reserved.
;Purpose:
;       This file defines the modeflag values for spawnxx calls.
;       Also contains the function argument declarations for all
;       process control related routines.
_P_WAIT = 0
_P_NOWAIT = 1
_OLD_P_OVERLAY = 2
_P_NOWAITO = 3
_P_DETACH = 4
_P_OVERLAY = 2

_WAIT_CHILD = 0
_WAIT_GRANDCHILD = 1

P_WAIT = _P_WAIT
P_NOWAIT = _P_NOWAIT
P_OVERLAY = _P_OVERLAY
OLD_P_OVERLAY = _OLD_P_OVERLAY
P_NOWAITO = _P_NOWAITO
P_DETACH = _P_DETACH
WAIT_CHILD = _WAIT_CHILD
WAIT_GRANDCHILD = _WAIT_GRANDCHILD

;srv.h
;Open Data Services header file: srv.h
;Copyright (c) Microsoft Corporation. All rights reserved.
struct DBDATETIME
       dtdays dd ?
       dttime dd ?
ends

struct DBMONEY
       mnyhigh dd ?
       mnylow dd ?
ends

struct DBDATETIM4
       numdays dd ?
       nummins dd ?
ends

MAXNUMERICLEN = 16

struct DBNUMERIC
       precision db ?
       scale db ?
       sign db ?
       val db MAXNUMERICLEN dup(?)
ends

SRV_TDS_NULL = $1f
SRV_TDS_TEXT = $23
SRV_TDS_GUID = $24
SRV_TDS_VARBINARY = $25
SRV_TDS_INTN = $26
SRV_TDS_VARCHAR = $27
SRV_TDS_BINARY = $2d
SRV_TDS_IMAGE = $22
SRV_TDS_CHAR = $2f
SRV_TDS_INT1 = $30
SRV_TDS_BIT = $32
SRV_TDS_INT2 = $34
SRV_TDS_DECIMAL = $37
SRV_TDS_INT4 = $38
SRV_TDS_DATETIM4 = $3a
SRV_TDS_FLT4 = $3b
SRV_TDS_MONEY = $3c
SRV_TDS_DATETIME = $3d
SRV_TDS_FLT8 = $3e
SRV_TDS_NUMERIC = $3f
SRV_TDS_SSVARIANT = $62
SRV_TDS_NTEXT = $63
SRV_TDS_BITN = $68
SRV_TDS_DECIMALN = $6a
SRV_TDS_NUMERICN = $6c
SRV_TDS_FLTN = $6d
SRV_TDS_MONEYN = $6e
SRV_TDS_DATETIMN = $6f
SRV_TDS_MONEY4 = $7a
SRV_TDS_INT8 = $7f
SRV_TDS_BIGVARBINARY = $A5
SRV_TDS_BIGVARCHAR = $A7
SRV_TDS_BIGBINARY = $AD
SRV_TDS_BIGCHAR = $AF
SRV_TDS_NVARCHAR = $e7
SRV_TDS_NCHAR = $ef

SRVNULL = SRV_TDS_NULL
SRVTEXT = SRV_TDS_TEXT
SRVGUID = SRV_TDS_GUID
SRVVARBINARY = SRV_TDS_VARBINARY
SRVINTN = SRV_TDS_INTN
SRVVARCHAR = SRV_TDS_VARCHAR
SRVBINARY = SRV_TDS_BINARY
SRVIMAGE = SRV_TDS_IMAGE
SRVCHAR = SRV_TDS_CHAR
SRVINT1 = SRV_TDS_INT1
SRVBIT = SRV_TDS_BIT
SRVINT2 = SRV_TDS_INT2
SRVDECIMAL = SRV_TDS_DECIMAL
SRVINT4 = SRV_TDS_INT4
SRVDATETIM4 = SRV_TDS_DATETIM4
SRVFLT4 = SRV_TDS_FLT4
SRVMONEY = SRV_TDS_MONEY
SRVDATETIME = SRV_TDS_DATETIME
SRVFLT8 = SRV_TDS_FLT8
SRVNUMERIC = SRV_TDS_NUMERIC
SRVSSVARIANT = SRV_TDS_SSVARIANT
SRVNTEXT = SRV_TDS_NTEXT
SRVBITN = SRV_TDS_BITN
SRVDECIMALN = SRV_TDS_DECIMALN
SRVNUMERICN = SRV_TDS_NUMERICN
SRVFLTN = SRV_TDS_FLTN
SRVMONEYN = SRV_TDS_MONEYN
SRVDATETIMN = SRV_TDS_DATETIMN
SRVMONEY4 = SRV_TDS_MONEY4
SRVINT8 = SRV_TDS_INT8
SRVBIGVARBINARY = SRV_TDS_BIGVARBINARY
SRVBIGVARCHAR = SRV_TDS_BIGVARCHAR
SRVBIGBINARY = SRV_TDS_BIGBINARY
SRVBIGCHAR = SRV_TDS_BIGCHAR
SRVNVARCHAR = SRV_TDS_NVARCHAR
SRVNCHAR = SRV_TDS_NCHAR

SRV_ERROR = 0
SRV_DONE = 1
SRV_DATATYPE = 2
SRV_EVENT = 4
SRV_ENO_OS_ERR = 0
SRV_INFO = 1
SRV_FATAL_PROCESS = 10
SRV_FATAL_SERVER = 19
SRV_CONTINUE = 0
SRV_LANGUAGE = 1
SRV_CONNECT = 2
SRV_RPC = 3
SRV_RESTART = 4
SRV_DISCONNECT = 5
SRV_ATTENTION = 6
SRV_SLEEP = 7
SRV_START = 8
SRV_STOP = 9
SRV_EXIT = 10
SRV_CANCEL = 11
SRV_SETUP = 12
SRV_CLOSE = 13
SRV_PRACK = 14
SRV_PRERROR = 15
SRV_ATTENTION_ACK = 16
SRV_CONNECT_V7 = 16
SRV_SKIP = 17
SRV_TRANSMGR = 18
SRV_PRELOGIN = 19
SRV_OLEDB = 20
SRV_INTERNAL_HANDLER = 99
SRV_PROGRAMMER_DEFINED = 100

SRV_SERVERNAME = 0
SRV_VERSION = 6
SRV_NULLTERM = -1
SRV_MSG_INFO = 1
SRV_MSG_ERROR = 2
SRV_DONE_FINAL = 0
SRV_DONE_MORE = 1
SRV_DONE_ERROR = 2
SRV_DONE_COUNT = $10
SRV_DONE_RPC_IN_BATCH = $80
SRV_PARAMRETURN = 1
SRV_PARAMDEFAULT = 2
SRV_PARAMSORTORDER = 4
SRV_RECOMPILE = 1
SRV_NOMETADATA = 2
SRV_SPID = 10
SRV_NETSPID = 11
SRV_TYPE = 12
SRV_STATUS = 13
SRV_RMTSERVER = 14
SRV_HOST = 15
SRV_USER = 16
SRV_PWD = 17
SRV_CPID = 18
SRV_APPLNAME = 19
SRV_TDS = 20
SRV_CLIB = 21
SRV_LIBVERS = 22
SRV_ROWSENT = 23
SRV_BCPFLAG = 24
SRV_NATLANG = 25
SRV_PIPEHANDLE = 26
SRV_NETWORK_MODULE = 27
SRV_NETWORK_VERSION = 28
SRV_NETWORK_CONNECTION = 29
SRV_LSECURE = 30
SRV_SAXP = 31
SRV_UNICODE_USER = 33
SRV_UNICODE_PWD = 35
SRV_SPROC_CODEPAGE = 36
SRV_MSGLCID = 37
SRV_INSTANCENAME = 38
SRV_HASHPWD = 39
SRV_UNICODE_CURRENTLOGIN = 40
SRV_TDS_NONE = 0
SRV_TDS_2_0 = 1
SRV_TDS_3_4 = 2
SRV_TDS_4_2 = 3
SRV_TDS_6_0 = 4
SRV_TDS_7_0 = 5
SRV_DUPLICATE_HANDLER = 2

SUCCEED = 1
FAIL = 0

SS_MAJOR_VERSION = 7
SS_MINOR_VERSION = 0
SS_LEVEL_VERSION = 0
SS_MINIMUM_VERSION equ "7.00.00.0000"
ODS_VERSION = ((SS_MAJOR_VERSION shl 24) or (SS_MINOR_VERSION shl 16))

;crtdbg.h - Supports debugging features of the C runtime library.
;       Copyright (c) Microsoft Corporation. All rights reserved.
;Purpose:
;       Support CRT debugging features.
_CRT_WARN = 0
_CRT_ERROR = 1
_CRT_ASSERT = 2
_CRT_ERRCNT = 3

_CRTDBG_MODE_FILE = 1
_CRTDBG_MODE_DEBUG = 2
_CRTDBG_MODE_WNDW = 4
_CRTDBG_REPORT_MODE = -1

_CRTDBG_INVALID_HFILE = -1
_CRTDBG_HFILE_ERROR = -2
_CRTDBG_FILE_STDOUT = -4
_CRTDBG_FILE_STDERR = -5
_CRTDBG_REPORT_FILE = -6

_CRT_RPTHOOK_INSTALL = 0
_CRT_RPTHOOK_REMOVE = 1

_HOOK_ALLOC = 1
_HOOK_REALLOC = 2
_HOOK_FREE = 3

_CRTDBG_ALLOC_MEM_DF = 1
_CRTDBG_DELAY_FREE_MEM_DF = 2
_CRTDBG_CHECK_ALWAYS_DF = 4
_CRTDBG_RESERVED_DF = 8
_CRTDBG_CHECK_CRT_DF = $10
_CRTDBG_LEAK_CHECK_DF = $20

_CRTDBG_CHECK_EVERY_16_DF = $100000
_CRTDBG_CHECK_EVERY_128_DF = $800000
_CRTDBG_CHECK_EVERY_1024_DF = $4000000
_CRTDBG_CHECK_DEFAULT_DF = 0
_CRTDBG_REPORT_FLAG = -1

;_BLOCK_TYPE(block)          (block & 0xFFFF)
;_BLOCK_SUBTYPE(block)       (block >> 16 & 0xFFFF)
_FREE_BLOCK = 0
_NORMAL_BLOCK = 1
_CRT_BLOCK = 2
_IGNORE_BLOCK = 3
_CLIENT_BLOCK = 4
_MAX_BLOCKS = 5

struct CRTMEMSTATE
       pBlockHeader dq ?
       lCounts dq _MAX_BLOCKS dup(?)
       lSizes dq _MAX_BLOCKS dup(?)
       lHighWaterCount dq ?
       lTotalCount dq ?
ends

;stdio.h - definitions/declarations for standard I/O routines
;       Copyright (c) Microsoft Corporation. All rights reserved.
;Purpose:
;       This file defines the structures, values, macros, and functions
;       used by the level 2 I/O ("standard I/O") routines.
;       [ANSI/System V]
BUFSIZ = 512
_NSTREAM_ = 512
_NFILE = _NSTREAM_
_IOB_ENTRIES = 20
EOF = -1

struct IOBUF
       _ptr dq ?
       _cnt dd ?
       _pad1 dd ?
       _base dq ?
       _flag dd ?
       _file dd ?
       _charbuf dd ?
       _bufsiz dd ?
       _tmpfname dq ?
ends
FILE equ IOBUF

L_ctermid = 9
L_cuserid = 32

SEEK_CUR = 1
SEEK_END = 2
SEEK_SET = 0

FILENAME_MAX = 260
FOPEN_MAX = 20
_SYS_OPEN = 20
TMP_MAX = 32767

_TMP_MAX_S = 2147483647
TMP_MAX_S = _TMP_MAX_S

;stdin  (&__iob_func()[0])
;stdout (&__iob_func()[1])
;stderr (&__iob_func()[2])

_IOREAD = 1
_IOWRT = 2
_IOFBF = 0
_IOLBF = $40
_IONBF = 4
_IOMYBUF = 8
_IOEOF = $10
_IOERR = $20
_IOSTRG = $40
_IORW = $80
_IOAPPEND = $200

_TWO_DIGIT_EXPONENT = 1
WEOF = $FFFF

;stdlib.h - declarations/definitions for commonly used library functions
;       Copyright (c) Microsoft Corporation. All rights reserved.
;Purpose:
;       This include file contains the function declarations for commonly
;       used library functions which either don't fit somewhere else, or,
;       cannot be declared in the normal place for other reasons.
;       [ANSI]
EXIT_SUCCESS = 0
EXIT_FAILURE = 1

RAND_MAX = $7fff

_MAX_PATH = 260
_MAX_DRIVE = 3
_MAX_DIR = 256
_MAX_FNAME = 256
_MAX_EXT = 256

_OUT_TO_DEFAULT = 0
_OUT_TO_STDERR = 1
_OUT_TO_MSGBOX = 2
_REPORT_ERRMODE = 3

_WRITE_ABORT_MSG = 1
_CALL_REPORTFAULT = 2
_MAX_ENV = 32767

_CVTBUFSIZE = 309+40

;wchar.h - declarations for wide character functions
;       Copyright (c) Microsoft Corporation. All rights reserved.
;Purpose:
;       This file contains the types, macros and function declarations for
;       all wide character-related functions.  They may also be declared in
;       individual header files on a functional basis.
WCHAR_MIN = 0
WCHAR_MAX = $ffff

WEOF = $FFFF

_UPPER = 1
_LOWER = 2
_DIGIT = 4
_SPACE = 8

_PUNCT = $10
_CONTROL = $20
_BLANK = $40
_HEX = $80

_LEADBYTE = $8000
_ALPHA = $100 or _UPPER or _LOWER

struct STAT32
       st_dev dd ?
       st_ino dd ?
       st_mode dw ?
       st_nlink dw ?
       st_uid dw ?
       st_gid dw ?
       st_rdev dd ?
       st_size dd ?
       st_atime dd ?
       st_mtime dd ?
       st_ctime dd ?
ends

struct STAT32I64
       st_dev dd ?
       st_ino dd ?
       st_mode dw ?
       st_nlink dw ?
       st_uid dw ?
       st_gid dw ?
       st_rdev dd ?
       st_pad1 dd ?
       st_size dq ?
       st_atime dd ?
       st_mtime dd ?
       st_ctime dd ?
       st_pad2 dd ?
ends

struct STAT64I32
       st_dev dd ?
       st_ino dd ?
       st_mode dw ?
       st_nlink dw ?
       st_uid dw ?
       st_gid dw ?
       st_rdev dd ?
       st_size dd ?
       st_atime dq ?
       st_mtime dq ?
       st_ctime dq ?
ends

struct STAT64
       st_dev dd ?
       st_ino dd ?
       st_mode dw ?
       st_nlink dw ?
       st_uid dw ?
       st_gid dw ?
       st_rdev dd ?
       st_pad1 dd ?
       st_size dq ?
       st_atime dq ?
       st_mtime dq ?
       st_ctime dq ?
ends

;PENWIN.H -  Pen Windows functions, types, and definitions
;            Version 2.0
;            Copyright (c) 1992-1999 Microsoft Corp. All rights reserved.

;Definitions 1: for everything including RC compiler
;Enabled Alphabet:
ALC_DEFAULT = 0
ALC_LCALPHA = 1
ALC_UCALPHA = 2
ALC_NUMERIC = 4
ALC_PUNC = 8
ALC_MATH = $10
ALC_MONETARY = $20
ALC_OTHER = $40
ALC_ASCII = $80
ALC_WHITE = $100
ALC_NONPRINT = $200
ALC_DBCS = $400
ALC_JIS1 = $800
ALC_GESTURE = $4000
ALC_USEBITMAP = $8000
ALC_HIRAGANA = $10000
ALC_KATAKANA = $20000
ALC_KANJI = $40000
ALC_GLOBALPRIORITY = $10000000
ALC_OEM = $FF80000
ALC_RESERVED = $E0003000
ALC_NOPRIORITY = 0

ALC_ALPHA = (ALC_LCALPHA or ALC_UCALPHA)
ALC_ALPHANUMERIC = (ALC_ALPHA or ALC_NUMERIC)
ALC_SYSMINIMUM = (ALC_ALPHANUMERIC or ALC_PUNC or ALC_WHITE or ALC_GESTURE)
ALC_ALL = (ALC_SYSMINIMUM or ALC_MATH or ALC_MONETARY or ALC_OTHER or ALC_NONPRINT)
ALC_KANJISYSMINIMUM = (ALC_SYSMINIMUM or ALC_HIRAGANA or ALC_KATAKANA or ALC_JIS1)
ALC_KANJIALL = (ALC_ALL or ALC_HIRAGANA or ALC_KATAKANA or ALC_KANJI)

BXS_NONE = 0
BXS_RECT = 1
BXS_BOXCROSS = 4
BXS_NOWRITING = 8

OBM_SKBBTNUP = 32767
OBM_SKBBTNDOWN = 32766
OBM_SKBBTNDISABLED = 32765
OBM_ZENBTNUP = 32764
OBM_ZENBTNDOWN = 32763
OBM_ZENBTNDISABLED = 32762
OBM_HANBTNUP = 32761
OBM_HANBTNDOWN = 32760
OBM_HANBTNDISABLED = 32759
OBM_KKCBTNUP = 32758
OBM_KKCBTNDOWN = 32757
OBM_KKCBTNDISABLED = 32756
OBM_SIPBTNUP = 32755
OBM_SIPBTNDOWN = 32754
OBM_SIPBTNDISABLED = 32753
OBM_PTYBTNUP = 32752
OBM_PTYBTNDOWN = 32751
OBM_PTYBTNDISABLED = 32750

IDC_PEN  = 32631
IDC_ALTSELECT = 32501

SYV_NULL = 0
SYV_UNKNOWN = 1
SYV_EMPTY = 3
SYV_BEGINOR = $10
SYV_ENDOR = $11
SYV_OR = $12
SYV_SOFTNEWLINE = $20
SYV_SPACENULL = $10000
SYV_SELECTFIRST = $2FFC0
SYV_LASSO = $2FFC1
SYV_SELECTLEFT = $2FFC2
SYV_SELECTRIGHT = $2FFC3
SYV_SELECTLAST = $2FFCF
SYV_CLEARCHAR = $2FFD2
SYV_HELP = $2FFD3
SYV_KKCONVERT = $2FFD4
SYV_CLEAR = $2FFD5
SYV_INSERT = $2FFD6
SYV_CONTEXT = $2FFD7
SYV_EXTENDSELECT = $2FFD8
SYV_UNDO = $2FFD9
SYV_COPY = $2FFDA
SYV_CUT = $2FFDB
SYV_PASTE = $2FFDC
SYV_CLEARWORD = $2FFDD
SYV_USER = $2FFDE
SYV_CORRECT = $2FFDF
SYV_BACKSPACE = $20008
SYV_TAB = $20009
SYV_RETURN = $2000D
SYV_SPACE = $20020
SYV_APPGESTUREMASK = $20000
SYV_CIRCLEUPA = $224B6
SYV_CIRCLEUPZ = $224CF
SYV_CIRCLELOA = $224D0
SYV_CIRCLELOZ = $224E9
SYV_SHAPELINE = $40001
SYV_SHAPEELLIPSE = $40002
SYV_SHAPERECT = $40003
SYV_SHAPEMIN = SYV_SHAPELINE
SYV_SHAPEMAX = SYV_SHAPERECT

SYVHI_SPECIAL = 0
SYVHI_ANSI = 1
SYVHI_GESTURE = 2
SYVHI_KANJI = 3
SYVHI_SHAPE = 4
SYVHI_UNICODE = 5
SYVHI_VKEY = 6

IEM_UNDO = 1
IEM_CUT = 2
IEM_COPY = 3
IEM_PASTE = 4
IEM_CLEAR = 5
IEM_SELECTALL  = 6
IEM_ERASE = 7
IEM_PROPERTIES = 8
IEM_LASSO = 9
IEM_RESIZE = 10
IEM_USER = 100

IES_BORDER = 1
IES_HSCROLL = 2
IES_VSCROLL = 4
IES_OWNERDRAW = 8

AI_CBSTROKE = $FFFF
AI_SKIPUPSTROKES = 1
CMPD_COMPRESS = 1
CMPD_DECOMPRESS = 2
CPDR_BOX = 1
CPDR_LASSO = 2
CPD_DEFAULT = $47F
CPD_USERBYTE = $100
CPD_USERWORD = $200
CPD_USERDWORD = $300
CPD_TIME = $400
DPD_HDCPEN = 1
DPD_DRAWSEL = 2
EPDP_REMOVE = 1

EPDS_SELECT = 1
EPDS_STROKEINDEX = 2
EPDS_USER = 3
EPDS_PENTIP = 4
EPDS_TIPCOLOR = 5
EPDS_TIPWIDTH = 6
EPDS_TIPNIB = 7
EPDS_INKSET = 8
EPDS_EQ = 0
EPDS_LT = $10
EPDS_GT = $20
EPDS_NOT = $40
EPDS_NE = $40
EPDS_GTE = $50
EPDS_LTE = $60
EPDS_REMOVE = $8000

GPA_MAXLEN = 1
GPA_POINTS = 2
GPA_PDTS = 3
GPA_RATE = 4
GPA_RECTBOUND = 5
GPA_RECTBOUNDINK = 6
GPA_SIZE = 7
GPA_STROKES = 8
GPA_TIME = 9
GPA_USER = 10
GPA_VERSION = 11

GSA_PENTIP = 1
GSA_PENTIPCLASS = 2
GSA_USER = 3
GSA_USERCLASS = 4
GSA_TIME = 5
GSA_SIZE = 6
GSA_SELECT = 7
GSA_DOWN = 8
GSA_RECTBOUND = 9
GSA_PENTIPTABLE = 10
GSA_SIZETABLE = 11
GSA_USERTABLE = 12

IX_END = $FFFF

PENTIP_NIBDEFAULT = 0
PENTIP_HEIGHTDEFAULT = 0
PENTIP_OPAQUE = $FF
PENTIP_HILITE = $80
PENTIP_TRANSPARENT = 0

PDR_NOHIT = 3
PDR_HIT = 2
PDR_OK = 1
PDR_CANCEL = 0

PDR_ERROR = -1
PDR_PNDTERR = -2
PDR_VERSIONERR = -3
PDR_COMPRESSED = -4
PDR_STRKINDEXERR = -5
PDR_PNTINDEXERR = -6
PDR_MEMERR = -7
PDR_INKSETERR = -8
PDR_ABORT = -9
PDR_NA = -10

PDR_USERDATAERR = -16
PDR_SCALINGERR = -17
PDR_TIMESTAMPERR = -18
PDR_OEMDATAERR = -19
PDR_SCTERR = -20

PDTS_LOMETRIC = 0
PDTS_HIMETRIC = 1
PDTS_HIENGLISH = 2
PDTS_STANDARDSCALE = 2
PDTS_DISPLAY = 3
PDTS_ARBITRARY = 4
PDTS_SCALEMASK = $F

PDTT_DEFAULT = 0
PDTT_PENINFO = $100
PDTT_UPPOINTS = $200
PDTT_OEMDATA = $400
PDTT_COLLINEAR = $800
PDTT_COLINEAR = $800
PDTT_DECOMPRESS = $4000
PDTT_COMPRESS = $8000
PDTT_ALL = $F00

PHW_NONE = 0
PHW_PRESSURE = 1
PHW_HEIGHT = 2
PHW_ANGLEXY = 4
PHW_ANGLEZ = 8
PHW_BARRELROTATION = $10
PHW_OEMSPECIFIC = $20
PHW_PDK = $40
PHW_ALL = $7F

PDTS_COMPRESS2NDDERIV = $10
PDTS_COMPRESSMETHOD = $F0
PDTS_NOPENINFO = $100
PDTS_NOUPPOINTS = $200
PDTS_NOOEMDATA = $400
PDTS_NOCOLLINEAR = $800
PDTS_NOCOLINEAR = $800
PDTS_NOTICK = $1000
PDTS_NOUSER = $2000
PDTS_NOEMPTYSTROKES = $4000
PDTS_COMPRESSED = $8000

SSA_PENTIP = 1
SSA_PENTIPCLASS = 2
SSA_USER = 3
SSA_USERCLASS = 4
SSA_TIME = 5
SSA_SELECT = 6
SSA_DOWN = 7
SSA_PENTIPTABLE = 8
SSA_USERTABLE = 9

TIP_ERASECOLOR = 1

TPD_RECALCSIZE = 0
TPD_USER = $80
TPD_TIME = $100
TPD_UPPOINTS = $200
TPD_COLLINEAR = $400
TPD_COLINEAR = $400
TPD_PENINFO = $800
TPD_PHW = $1000
TPD_OEMDATA = $1000
TPD_EMPTYSTROKES = $2000
TPD_EVERYTHING = $3FFF

cbDictPathMax = 255
DIRQ_QUERY = 1
DIRQ_DESCRIPTION  = 2
DIRQ_CONFIGURE = 3
DIRQ_OPEN = 4
DIRQ_CLOSE = 5
DIRQ_SETWORDLISTS = 6
DIRQ_STRING = 7
DIRQ_SUGGEST = 8
DIRQ_ADD = 9
DIRQ_DELETE = 10
DIRQ_FLUSH = 11
DIRQ_RCCHANGE = 12
DIRQ_SYMBOLGRAPH = 13
DIRQ_INIT = 14
DIRQ_CLEANUP = 15
DIRQ_COPYRIGHT = 16
DIRQ_USER = 4096

BITPENUP = $8000

MSVCRT_DRV_RESERVED = $800

DRV_SetPenDriverEntryPoints = MSVCRT_DRV_RESERVED+1
DRV_SetEntryPoints = MSVCRT_DRV_RESERVED+1
DRV_RemovePenDriverEntryPoints	= MSVCRT_DRV_RESERVED+2
DRV_RemoveEntryPoints = MSVCRT_DRV_RESERVED+2
DRV_SetPenSamplingRate = MSVCRT_DRV_RESERVED+3
DRV_SetPenSamplingDist = MSVCRT_DRV_RESERVED+4
DRV_GetName = MSVCRT_DRV_RESERVED+5
DRV_GetVersion = MSVCRT_DRV_RESERVED+6
DRV_GetPenInfo = MSVCRT_DRV_RESERVED+7
DRV_PenPlayStart = MSVCRT_DRV_RESERVED+8
DRV_PenPlayBack = MSVCRT_DRV_RESERVED+9
DRV_PenPlayStop = MSVCRT_DRV_RESERVED+10
DRV_GetCalibration = MSVCRT_DRV_RESERVED+11
DRV_SetCalibration = MSVCRT_DRV_RESERVED+12
DRV_Reserved1 = MSVCRT_DRV_RESERVED+13
DRV_Reserved2 = MSVCRT_DRV_RESERVED+14
DRV_Query = MSVCRT_DRV_RESERVED+15
DRV_GetPenSamplingRate = MSVCRT_DRV_RESERVED+16
DRV_Calibrate = MSVCRT_DRV_RESERVED+17

PLAY_VERSION_10_DATA = 0
PLAY_VERSION_20_DATA = 1

DRV_FAILURE = 0
DRV_SUCCESS = 1
DRV_BADPARAM1 = $FFFFFFFF
DRV_BADPARAM2 = $FFFFFFFE
DRV_BADSTRUCT = $FFFFFFFD

PENREG_DEFAULT = 2
PENREG_WILLHANDLEMOUSE = 1
MAXOEMDATAWORDS = 6

PCM_PENUP = 1
PCM_RANGE = 2
PCM_INVERT = $20
PCM_RECTEXCLUDE = $2000
PCM_RECTBOUND = $4000
PCM_TIMEOUT = $8000
PCM_RGNBOUND = $10000
PCM_RGNEXCLUDE = $20000
PCM_DOPOLLING = $40000
PCM_TAPNHOLD = $80000
PCM_ADDDEFAULTS = RC_LDEFAULTFLAGS

PDC_INTEGRATED = 1
PDC_PROXIMITY = 2
PDC_RANGE = 4
PDC_INVERT = 8
PDC_RELATIVE = $10
PDC_BARREL1 = $20
PDC_BARREL2 = $40
PDC_BARREL3 = $80

PDK_NULL = 0
PDK_UP = 0
PDK_DOWN = 1
PDK_BARREL1 = 2
PDK_BARREL2 = 4
PDK_BARREL3 = 8
PDK_SWITCHES = $f
PDK_TRANSITION = $10
PDK_UNUSED10 = $20
PDK_UNUSED20 = $40
PDK_INVERTED = $80
PDK_PENIDMASK = $F00
PDK_UNUSED1000 = $1000
PDK_INKSTOPPED = $2000
PDK_OUTOFRANGE = $4000
PDK_DRIVER = $8000
PDK_TIPMASK = 1

PDT_NULL = 0
PDT_PRESSURE = 1
PDT_HEIGHT = 2
PDT_ANGLEXY = 3
PDT_ANGLEZ = 4
PDT_BARRELROTATION = 5
PDT_OEMSPECIFIC = 16

PID_CURRENT = -1

REC_OEM = -1024
REC_LANGUAGE = -48
REC_GUIDE = -47
REC_PARAMERROR = -46
REC_INVALIDREF = -45
REC_RECTEXCLUDE = -44
REC_RECTBOUND = -43
REC_PCM = -42
REC_RESULTMODE = -41
REC_HWND = -40
REC_ALC = -39
REC_ERRORLEVEL = -38
REC_CLVERIFY = -37
REC_DICT = -36
REC_HREC = -35
REC_BADEVENTREF = -33
REC_NOCOLLECTION = -32
REC_DEBUG = -32
REC_POINTEREVENT = -31
REC_BADHPENDATA = -9
REC_OOM = -8
REC_NOINPUT = -7
REC_NOTABLET = -6
REC_BUSY = -5
REC_BUFFERTOOSMALL = -4
REC_ABORT = -3
REC_NA = -2
REC_OVERFLOW = -1
REC_OK = 0
REC_TERMBOUND = 1
REC_TERMEX = 2
REC_TERMPENUP = 3
REC_TERMRANGE = 4
REC_TERMTIMEOUT = 5
REC_DONE = 6
REC_TERMOEM = 512

GRH_ALL = 0
GRH_GESTURE = 1
GRH_NONGESTURE = 2

;#ifdef JAPAN
;GST_SEL = 1
;GST_CLIP = 2
;GST_WHITE = 4
;GST_KKCONVERT = 8
;GST_EDIT = $10
;GST_SYS = $1F
;GST_CIRCLELO = $100
;GST_CIRCLEUP = $200
;GST_CIRCLE = $300
;GST_ALL = $31F
;#else

GST_SEL = 1
GST_CLIP = 2
GST_WHITE = 4
GST_EDIT = 10
GST_SYS = 17
GST_CIRCLELO = 100
GST_CIRCLEUP = 200
GST_CIRCLE = 300
GST_ALL = 317

HRCR_NORESULTS = 4
HRCR_COMPLETE = 3
HRCR_GESTURE = 2
HRCR_OK = 1
HRCR_INCOMPLETE = 0
HRCR_ERROR = -1
HRCR_MEMERR = -2
HRCR_INVALIDGUIDE = -3
HRCR_INVALIDPNDT = -4
HRCR_UNSUPPORTED = -5
HRCR_CONFLICT = -6
HRCR_HOOKED = -8

HWL_SYSTEM  = 1

ISR_ERROR = -1
ISR_BADINKSET = -2
ISR_BADINDEX = -3

IX_END = $FFFF
MAXHOTSPOT = 8

PH_MAX = $FFFFFFFF
PH_DEFAULT = $FFFFFFFE
PH_MIN = $FFFFFFFD

RHH_STD = 0
RHH_BOX = 1

SCH_NONE = 0
SCH_ADVISE = 1
SCH_FORCE = 2

SCIM_INSERT = 0
SCIM_OVERWRITE = 1

SRH_HOOKALL = 1

SSH_RD = 1
SSH_RU = 2
SSH_LD = 3
SSH_LU = 4
SSH_DL = 5
SSH_DR = 6
SSH_UL = 7
SSH_UR = 8

SIH_ALLANSICHAR = 1

TH_QUERY = 0
TH_FORCE = 1
TH_SUGGEST = 2

TRAIN_NONE = 0
TRAIN_DEFAULT = 1
TRAIN_CUSTOM = 2
TRAIN_BOTH = (TRAIN_DEFAULT or TRAIN_CUSTOM)

TRAIN_SAVE = 0
TRAIN_REVERT = 1
TRAIN_RESET = 2

WCR_RECOGNAME = 0
WCR_QUERY = 1
WCR_CONFIGDIALOG = 2
WCR_DEFAULT = 3
WCR_RCCHANGE = 4
WCR_VERSION = 5
WCR_TRAIN = 6
WCR_TRAINSAVE = 7
WCR_TRAINMAX  = 8
WCR_TRAINDIRTY = 9
WCR_TRAINCUSTOM = 10
WCR_QUERYLANGUAGE = 11
WCR_USERCHANGE = 12

WCR_PWVERSION = 13
WCR_GETALCPRIORITY = 14
WCR_SETALCPRIORITY = 15
WCR_GETANSISTATE = 16
WCR_SETANSISTATE = 17
WCR_GETHAND = 18
WCR_SETHAND = 19
WCR_GETDIRECTION = 20
WCR_SETDIRECTION = 21
WCR_INITRECOGNIZER = 22
WCR_CLOSERECOGNIZER = 23

WCR_PRIVATE = 1024

CRUC_NOTIFY = 0
CRUC_REMOVE = 1

WLT_STRING = 0
WLT_STRINGTABLE = 1
WLT_EMPTY = 2
WLT_WORDLIST = 3

IEB_DEFAULT = 0
IEB_BRUSH = 1
IEB_BIT_UL = 2
IEB_BIT_CENTER = 3
IEB_BIT_TILE = 4
IEB_BIT_STRETCH = 5
IEB_OWNERDRAW = 6

IEDO_NONE = 0
IEDO_FAST = 1
IEDO_SAVEUPSTROKES = 2
IEDO_RESERVED = $FFFC

IEI_MOVE = 1
IEI_RESIZE = 2
IEI_CROP = 4
IEI_DISCARD = 8
IEI_RESERVED = $FFF0

IEGI_ALL = 0
IEGI_SELECTION = 1

IEMODE_READY = 0
IEMODE_ERASE = 1
IEMODE_LASSO = 2

IEN_NULL = 0
IEN_PDEVENT = 1
IEN_PAINT = 2
IEN_FOCUS = 4
IEN_SCROLL = 8
IEN_EDIT = $10
IEN_PROPERTIES = $20
IEN_RESERVED = $FF80

IER_OK = 0
IER_NO = 0
IER_YES = 1
IER_ERROR = -1
IER_PARAMERR = -2
IER_OWNERDRAW = -3
IER_SECURITY = -4
IER_SELECTION = -5
IER_SCALE = -6
IER_MEMERR = -7
IER_NOCOMMAND = -8
IER_NOGESTURE = -9
IER_NOPDEVENT = -10
IER_NOTINPAINT = -11
IER_PENDATA = -12

IEREC_NONE = 0
IEREC_GESTURE = 1
IEREC_ALL = IEREC_GESTURE
IEREC_RESERVED = $FFFE

IESEC_NOCOPY = 1
IESEC_NOCUT = 2
IESEC_NOPASTE = 4
IESEC_NOUNDO = 8
IESEC_NOINK = $10
IESEC_NOERASE = $20
IESEC_NOGET = $40
IESEC_NOSET = $80
IESEC_RESERVED = $FF00

IESF_ALL = 1
IESF_SELECTION = 2
IESF_STROKE = 4

IESF_TIPCOLOR = $8
IESF_TIPWIDTH = $10
IESF_PENTIP = (IESF_TIPCOLOR or IESF_TIPWIDTH)

IESI_REPLACE = 0
IESI_APPEND = 1

IN_PDEVENT = (IEN_PDEVENT shl 8) or 0
IN_ERASEBKGND = (IEN_NULL shl 8) or 1
IN_PREPAINT = (IEN_PAINT shl 8) or 2
IN_PAINT = (IEN_NULL shl 8) or 3
IN_POSTPAINT = (IEN_PAINT shl 8) or 4
IN_MODECHANGED = (IEN_EDIT shl 8) or 5
IN_CHANGE = (IEN_EDIT shl 8) or 6
IN_UPDATE = (IEN_EDIT shl 8) or 7
IN_SETFOCUS = (IEN_FOCUS shl 8) or 8
IN_KILLFOCUS = (IEN_FOCUS shl 8) or 9
IN_MEMERR = (IEN_NULL shl 8) or 10
IN_HSCROLL = (IEN_SCROLL shl 8) or 11
IN_VSCROLL = (IEN_SCROLL shl 8) or 12
IN_GESTURE = (IEN_EDIT shl 8) or 13
IN_COMMAND = (IEN_EDIT shl 8) or 14
IN_CLOSE = (IEN_NULL shl 8) or 15
IN_PROPERTIES = (IEN_PROPERTIES shl 8) or 16

LRET_DONE = 1
LRET_ABORT = -1
LRET_HRC = -2
LRET_HPENDATA = -3
LRET_PRIVATE = -4

PCMR_OK = 0
PCMR_ALREADYCOLLECTING = -1
PCMR_INVALIDCOLLECTION = -2
PCMR_EVENTLOCK = -3
PCMR_INVALID_PACKETID = -4
PCMR_TERMTIMEOUT = -5
PCMR_TERMRANGE = -6
PCMR_TERMPENUP = -7
PCMR_TERMEX = -8
PCMR_TERMBOUND = -9
PCMR_APPTERMINATED = -10
PCMR_TAP = -11
PCMR_SELECT = -12
PCMR_OVERFLOW = -13
PCMR_ERROR = -14
PCMR_DISPLAYERR = -15
PCMR_TERMINVERT = -16

PII_INKCLIPRECT = 1
PII_INKSTOPRECT = 2
PII_INKCLIPRGN = 4
PII_INKSTOPRGN = 8
PII_INKPENTIP = $10
PII_SAVEBACKGROUND = $20
PII_CLIPSTOP = $40

PIT_RGNBOUND = 1
PIT_RGNEXCLUDE = 2
PIT_TIMEOUT = 4
PIT_TAPNHOLD = 8

CL_NULL = 0
CL_MINIMUM = 1
CL_MAXIMUM = 100
cwRcReservedMax = 8
ENUM_MINIMUM = 1
ENUM_MAXIMUM = 4096

HKP_SETHOOK = 0
HKP_UNHOOK = $FFFF

HWR_RESULTS = 0
HWR_APPWIDE = 1

iSycNull = -1
LPDFNULL = NULL
MAXDICTIONARIES = 16
wPntAll = $FFFF
cbRcLanguageMax = 44
cbRcUserMax = 32
cbRcrgbfAlcMax = 32
RC_WDEFAULT = $ffff
RC_LDEFAULT = $ffffffff
RC_WDEFAULTFLAGS = $8000
RC_LDEFAULTFLAGS = $80000000

CWR_REPLACECR = 1
CWR_STRIPCR = CWR_REPLACECR
CWR_STRIPLF = 2
CWR_REPLACETAB = 4
CWR_STRIPTAB = CWR_REPLACETAB
CWR_SINGLELINEEDIT = (CWR_REPLACECR or CWR_STRIPLF or CWR_REPLACETAB)
CWR_INSERT = 8
CWR_TITLE = $10
CWR_SIMPLE = $40
CWR_HEDIT = $80
CWR_KEYBOARD = $100
CWR_BOXES = $200

CWRK_DEFAULT = 0
CWRK_BASIC = 1
CWRK_FULL = 2
CWRK_NUMPAD = 3
CWRK_TELPAD = 4

;#ifdef JAPAN
;CBCAPTIONCWX = 256
;CKBCWX = 6
;XCWX = 20
;YCWX = 20
;CXCWX = 300
;CYCWX = 200

;CWX_TOPMOST = 1
;CWX_NOTOOLTIPS = 2
;CWX_EPERIOD = 4
;CWX_ECOMMA = 8
;CWX_DEFAULT = 0

;CWXA_CONTEXT = 1
;CWXA_KBD = 2
;CWXA_STATE = 4
;CWXA_PTUL = 8
;CWXA_SIZE = $10
;CWXA_NOUPDATEMRU = $20

;CWXK_HW 0
;CWXK_FIRST $100
;CWXK_50 $100
;CWXK_QWERTY $101
;CWXK_NUM $102
;CWXK_KANJI $103
;CWXK_CODE $104
;CWXK_YOMI $105

;CWXKS_DEFAULT = $ffff
;CWXKS_ZEN = 0
;CWXKS_HAN = 1
;CWXKS_ROMAZEN = 2
;CWXKS_ROMAHAN = 3
;CWXKS_HIRAZEN = 4
;CWXKS_KATAZEN = 5
;CWXKS_KATAHAN = 6

;CWXR_ERROR = -1
;CWXR_UNMODIFIED = 0
;CWXR_MODIFIED = 1
;#endif //JAPAN
;#ifdef JAPAN
;GPMI_OK = 0
;GPMI_INVALIDPMI = $8000

;INKWIDTH_MINIMUM = 0
;INKWIDTH_MAXIMUM = 15
;
;PMI_RCCHANGE = 0
;PMI_BEDIT = 1
;#ifdef JAPAN
;#endif //JAPAN
PMI_CXTABLET = 3
PMI_CYTABLET = 4
PMI_PENTIP = 6
PMI_ENABLEFLAGS = 7
PMI_TIMEOUT = 8
PMI_TIMEOUTGEST = 9
PMI_TIMEOUTSEL = 10
PMI_SYSFLAGS = 11
PMI_INDEXFROMRGB = 12
PMI_RGBFROMINDEX = 13
PMI_SYSREC = 14
PMI_TICKREF = 15
PMI_SAVE = $1000

GPR_CURSPEN = 1
GPR_CURSCOPY = 2
GPR_CURSUNKNOWN = 3
GPR_CURSERASE = 4
GPR_BMCRMONO = 5
GPR_BMLFMONO = 6
GPR_BMTABMONO = 7
GPR_BMDELETE = 8
GPR_BMLENSBTN = 9
GPR_BMHSPMONO = 10
GPR_BMZSPMONO = 11

PWE_AUTOWRITE = 1
PWE_ACTIONHANDLES = 2
PWE_INPUTCURSOR = 4
PWE_LENS = 8

PWF_RC1 = 1
PWF_PEN = 4
PWF_INKDISPLAY = 8
PWF_RECOGNIZER = $10
PWF_BEDIT = $100
PWF_HEDIT = $200
PWF_IEDIT = $400
PWF_ENHANCED = $1000
PWF_FULL = PWF_RC1 or PWF_PEN or PWF_INKDISPLAY or PWF_RECOGNIZER or PWF_BEDIT or PWF_HEDIT or\
	   PWF_IEDIT or PWF_ENHANCED

RPA_DEFAULT = 1
RPA_HEDIT = 1
RPA_KANJIFIXEDBEDIT = 2
RPA_DBCSPRIORITY = 4
RPA_SBCSPRIORITY = 8

PMIR_OK = 0
PMIR_INDEX = -1
PMIR_VALUE = -2
PMIR_INVALIDBOXEDITINFO = -3
PMIR_INIERROR = -4
PMIR_ERROR = -5
PMIR_NA = -6

;#ifdef JAPAN
;SPMI_OK = 0
;SPMI_INVALIDBOXEDITINFO = 1
;SPMI_INIERROR = 2
;SPMI_INVALIDPMI = $8000
;#endif //JAPAN

GGRC_OK = 0
GGRC_DICTBUFTOOSMALL = 1
GGRC_PARAMERROR = 2
GGRC_NA = 3

RCD_DEFAULT = 0
RCD_LR = 1
RCD_RL = 2
RCD_TB = 3
RCD_BT = 4

RCIP_ALLANSICHAR = 1
RCIP_MASK = 1

RCO_NOPOINTEREVENT = 1
RCO_SAVEALLDATA = 2
RCO_SAVEHPENDATA = 4
RCO_NOFLASHUNKNOWN = 8
RCO_TABLETCOORD = $10
RCO_NOSPACEBREAK = $20
RCO_NOHIDECURSOR = $40
RCO_NOHOOK = $80
RCO_BOXED = $100
RCO_SUGGEST = $200
RCO_DISABLEGESMAP = $400
RCO_NOFLASHCURSOR = $800
RCO_BOXCROSS = $1000
RCO_COLDRECOG = $8000
RCO_SAVEBACKGROUND = $10000
RCO_DODEFAULT = $20000

RCOR_NORMAL = 1
RCOR_RIGHT = 2
RCOR_UPSIDEDOWN = 3
RCOR_LEFT = 4

RCP_LEFTHAND = 1
RCP_MAPCHAR = 4

RCRT_DEFAULT = 0
RCRT_UNIDENTIFIED = 1
RCRT_GESTURE = 2
RCRT_NOSYMBOLMATCH = 4
RCRT_PRIVATE = $4000
RCRT_NORECOG = $8000
RCRT_ALREADYPROCESSED = 8
RCRT_GESTURETRANSLATED = $10
RCRT_GESTURETOKEYS = $20

RRM_STROKE = 0
RRM_SYMBOL = 1
RRM_WORD = 2
RRM_NEWLINE = 3
RRM_COMPLETE = 16

SGRC_OK = 0
SGRC_USER = 1
SGRC_PARAMERROR = 2
SGRC_RC = 4
SGRC_RECOGNIZER = 8
SGRC_DICTIONARY = $10
SGRC_INIFILE = $20
SGRC_NA = $8000

TPT_CLOSEST = 1
TPT_INTERSECTINK = 2
TPT_TEXTUAL = 4
TPT_DEFAULT = (TPT_TEXTUAL or TPT_INTERSECTINK or TPT_CLOSEST)

VWM_MOUSEMOVE = 1
VWM_MOUSELEFTDOWN = 2
VWM_MOUSELEFTUP = 4
VWM_MOUSERIGHTDOWN = 8
VWM_MOUSERIGHTUP = $10

WM_RCRESULT = (WM_PENWINFIRST+1)
WM_HOOKRCRESULT = (WM_PENWINFIRST+2)
WM_PENMISCINFO = (WM_PENWINFIRST+3)
WM_GLOBALRCCHANGE = (WM_PENWINFIRST+3)
WM_SKB = (WM_PENWINFIRST+4)
WM_PENCTL = (WM_PENWINFIRST+5)
WM_HEDITCTL = (WM_PENWINFIRST+5)

HE_GETRC = 3
HE_SETRC = 4
HE_GETINFLATE = 5
HE_SETINFLATE = 6
HE_GETUNDERLINE = 7
HE_SETUNDERLINE = 8
HE_GETINKHANDLE = 9
HE_SETINKMODE = 10
HE_STOPINKMODE = 11
HE_GETRCRESULTCODE = 12
HE_DEFAULTFONT = 13
HE_CHARPOSITION = 14
HE_CHAROFFSET = 15
HE_GETBOXLAYOUT = 20
HE_SETBOXLAYOUT = 21
HE_GETRCRESULT = 22

;#ifdef JAPAN
;HE_KKCONVERT = 30
;HE_GETKKCONVERT = 31
;HE_CANCELKKCONVERT = 32
;HE_FIXKKCONVERT = 33
;HE_GETKKSTATUS = 34
;HE_SETCONVERTRANGE = 35
;HE_GETCONVERTRANGE = 36
;HE_PUTCONVERTCHAR = 37
;#endif //JAPAN

HE_ENABLEALTLIST = 40
HE_SHOWALTLIST = 41
HE_HIDEALTLIST = 42
HE_GETLENSTYPE = 43
HE_SETLENSTYPE = 44

;#ifdef JAPAN
;HEKK_DEFAULT = 0
;HEKK_CONVERT = 1
;HEKK_CANDIDATE = 2
;HEKK_DBCSCHAR = 3
;HEKK_SBCSCHAR = 4
;HEKK_HIRAGANA = 5
;HEKK_KATAKANA = 6
;HEKKR_NOCONVERT = 0
;HEKKR_PRECONVERT = 1
;HEKKR_CONVERT = 2
;#endif //JAPAN

HEP_NORECOG = 0
HEP_RECOG = 1
HEP_WAITFORTAP = 2

HN_ENDREC = 4
HN_DELAYEDRECOGFAIL = 5
HN_RESULT = 20
HN_RCRESULT = HN_RESULT

;#ifdef JAPAN
;HN_ENDKKCONVERT = 30
;#endif //JAPAN
HN_BEGINDIALOG = 40
HN_ENDDIALOG = 41

IE_GETMODIFY = (EM_GETMODIFY)
IE_SETMODIFY = (EM_SETMODIFY)
IE_CANUNDO = (EM_CANUNDO)
IE_UNDO = (EM_UNDO)
IE_EMPTYUNDOBUFFER = (EM_EMPTYUNDOBUFFER)
IE_MSGFIRST = (WM_USER+150)
IE_GETINK = (IE_MSGFIRST+0)
IE_SETINK = (IE_MSGFIRST+1)
IE_GETPENTIP = (IE_MSGFIRST+2)
IE_SETPENTIP = (IE_MSGFIRST+3)
IE_GETERASERTIP = (IE_MSGFIRST+4)
IE_SETERASERTIP = (IE_MSGFIRST+5)
IE_GETBKGND = (IE_MSGFIRST+6)
IE_SETBKGND = (IE_MSGFIRST+7)
IE_GETGRIDORIGIN = (IE_MSGFIRST+8)
IE_SETGRIDORIGIN = (IE_MSGFIRST+9)
IE_GETGRIDPEN = (IE_MSGFIRST+10)
IE_SETGRIDPEN = (IE_MSGFIRST+11)
IE_GETGRIDSIZE = (IE_MSGFIRST+12)
IE_SETGRIDSIZE = (IE_MSGFIRST+13)
IE_GETMODE = (IE_MSGFIRST+14)
IE_SETMODE = (IE_MSGFIRST+15)
IE_GETINKRECT = (IE_MSGFIRST+16)
IE_GETAPPDATA = (IE_MSGFIRST+34)
IE_SETAPPDATA = (IE_MSGFIRST+35)
IE_GETDRAWOPTS = (IE_MSGFIRST+36)
IE_SETDRAWOPTS = (IE_MSGFIRST+37)
IE_GETFORMAT = (IE_MSGFIRST+38)
IE_SETFORMAT = (IE_MSGFIRST+39)
IE_GETINKINPUT = (IE_MSGFIRST+40)
IE_SETINKINPUT = (IE_MSGFIRST+41)
IE_GETNOTIFY = (IE_MSGFIRST+42)
IE_SETNOTIFY = (IE_MSGFIRST+43)
IE_GETRECOG = (IE_MSGFIRST+44)
IE_SETRECOG = (IE_MSGFIRST+45)
IE_GETSECURITY = (IE_MSGFIRST+46)
IE_SETSECURITY = (IE_MSGFIRST+47)
IE_GETSEL = (IE_MSGFIRST+48)
IE_SETSEL = (IE_MSGFIRST+49)
IE_DOCOMMAND = (IE_MSGFIRST+50)
IE_GETCOMMAND = (IE_MSGFIRST+51)
IE_GETCOUNT = (IE_MSGFIRST+52)
IE_GETGESTURE = (IE_MSGFIRST+53)
IE_GETMENU = (IE_MSGFIRST+54)
IE_GETPAINTDC = (IE_MSGFIRST+55)
IE_GETPDEVENT = (IE_MSGFIRST+56)
IE_GETSELCOUNT = (IE_MSGFIRST+57)
IE_GETSELITEMS = (IE_MSGFIRST+58)
IE_GETSTYLE = (IE_MSGFIRST+59)

CIH_NOGDMSG = 1
CIH_NOACTIONHANDLE = 2
CIH_NOEDITTEXT = 4
CIH_NOFLASHCURSOR = 8

HEAL_DEFAULT = -1
BEI_FACESIZE = 32
BEIF_BOXCROSS = 1

BESC_DEFAULT = 0
BESC_ROMANFIXED = 1
BESC_KANJIFIXED = 2
BESC_USERDEFINED = 3

CIB_NOGDMSG = 1
CIB_NOACTIONHANDLE = 2
CIB_NOFLASHCURSOR = 4
;#ifdef JAPAN
;CIB_NOWRITING = $10
;#endif // JAPAN

BXD_CELLWIDTH = 12
BXD_CELLHEIGHT = 16
BXD_BASEHEIGHT = 13
BXD_BASEHORZ = 0
BXD_MIDFROMBASE = 0
BXD_CUSPHEIGHT = 2
BXD_ENDCUSPHEIGHT = 4

BXDK_CELLWIDTH = 32
BXDK_CELLHEIGHT = 32
BXDK_BASEHEIGHT = 28
BXDK_BASEHORZ = 0
BXDK_MIDFROMBASE = 0
BXDK_CUSPHEIGHT = 28
BXDK_ENDCUSPHEIGHT = 10

WM_PENMISC = (WM_PENWINFIRST+6)

PMSC_BEDITCHANGE = 1
;PMSC_PENUICHANGE = 2
;PMSC_SUBINPCHANGE = 3
;PMSC_KKCTLENABLE = 4
PMSC_GETPCMINFO = 5
PMSC_SETPCMINFO = 6
PMSC_GETINKINGINFO = 7
PMSC_SETINKINGINFO = 8
PMSC_GETHRC = 9
PMSC_SETHRC = 10
PMSC_GETSYMBOLCOUNT = 11
PMSC_GETSYMBOLS = 12
PMSC_SETSYMBOLS = 13
PMSC_LOADPW = 15
PMSC_INKSTOP = 16

PMSCL_UNLOADED = 0
PMSCL_LOADED = 1
PMSCL_UNLOADING = 2

WM_CTLINIT = (WM_PENWINFIRST+7)

CTLINIT_HEDIT = 1
CTLINIT_BEDIT = 7
CTLINIT_IEDIT = 9
CTLINIT_MAX = 10

WM_PENEVENT = (WM_PENWINFIRST+8)

PE_PENDOWN = 1
PE_PENUP = 2
PE_PENMOVE = 3
PE_TERMINATING = 4
PE_TERMINATED = 5
PE_BUFFERWARNING = 6
PE_BEGININPUT = 7
PE_SETTARGETS = 8
PE_BEGINDATA = 9
PE_MOREDATA = 10
PE_ENDDATA = 11
PE_GETPCMINFO = 12
PE_GETINKINGINFO = 13
PE_ENDINPUT = 14
PE_RESULT = 15

;FPenUpX(x)  ((BOOL)(((x) & BITPENUP) != 0))
;GetWEventRef()  (LOWORD(GetMessageExtraInfo()))
;MpAlcB(lprc,i)          ((lprc)->rgbfAlc[((i) & 0xff) >> 3])
;MpIbf(i)                ((BYTE)(1 << ((i) & 7)))
;SetAlcBitAnsi(lprc,i)   do {MpAlcB(lprc,i) |= MpIbf(i);} while (0)
;ResetAlcBitAnsi(lprc,i) do {MpAlcB(lprc,i) &= ~MpIbf(i);} while (0)
;IsAlcBitAnsi(lprc, i)   ((MpAlcB(lprc,i) & MpIbf(i)) != 0)
;DrawPenDataFmt(hdc, lprect, hpndt)
;    DrawPenDataEx(hdc, lprect, hpndt, 0, IX_END, 0, IX_END, NULL, NULL, 0)
;dwDiffAT(at1, at2)  (1000L*((at2).sec - (at1).sec) - (DWORD)(at1).ms + (DWORD)(at2).ms)
;FLTAbsTime(at1, at2) ((at1).sec < (at2).sec || ((at1).sec == (at2).sec && (at1).ms < (at2).ms))
;FLTEAbsTime(at1, at2)\
;    ((at1).sec < (at2).sec || ((at1).sec == (at2).sec && (at1).ms <= (at2).ms))
;FEQAbsTime(at1, at2)   ((at1).sec == (at2).sec && (at1).ms == (at2).ms)
;FAbsTimeInInterval(at, lpi)  (FLTEAbsTime((lpi)->atBegin, at) && FLTEAbsTime(at, (lpi)->atEnd))
;FIntervalInInterval(lpiT, lpiS) (FLTEAbsTime((lpiS)->atBegin, (lpiT)->atBegin)\
;    && FLTEAbsTime((lpiT)->atEnd, (lpiS)->atEnd))
;FIntervalXInterval(lpiT, lpiS)   (!(FLTAbsTime((lpiT)->atEnd, (lpiS)->atBegin)\
;    || FLTAbsTime((lpiS)->atEnd, (lpiT)->atBegin)))
;dwDurInterval(lpi)  dwDiffAT((lpi)->atBegin, (lpi)->atEnd)
;MakeAbsTime(lpat, sec, ms) do {\
;    (lpat)->sec = sec + ((ms) / 1000);\
;    (lpat)->ms = (ms) % 1000;\
;} while (0)

;SYV macros:
;FIsSpecial(syv)         (HIWORD((syv))==SYVHI_SPECIAL)
;FIsAnsi(syv)            (HIWORD((syv))==SYVHI_ANSI)
;FIsGesture(syv)         (HIWORD((syv))==SYVHI_GESTURE)
;FIsKanji(syv)           (HIWORD((syv))==SYVHI_KANJI)
;FIsShape(syv)           (HIWORD((syv))==SYVHI_SHAPE)
;FIsUniCode(syv)         (HIWORD((syv))==SYVHI_UNICODE)
;FIsVKey(syv)            (HIWORD((syv))==SYVHI_VKEY)
;ChSyvToAnsi(syv)        ((BYTE) (LOBYTE(LOWORD((syv)))))
;WSyvToKanji(syv)        ((WORD) (LOWORD((syv))))
;SyvCharacterToSymbol(c) ((LONG)(unsigned char)(c) | 0x00010000)
;SyvKanjiToSymbol(c)     ((LONG)(UINT)(c) | 0x00030000)
;FIsSelectGesture(syv)   ((syv) >= SYVSELECTFIRST && (syv) <= SYVSELECTLAST)
;FIsStdGesture(syv)  FIsSelectGesture(syv) or\
;     ((syv)==SYV_CLEAR \
;   || (syv)==SYV_HELP           \
;   || (syv)==SYV_EXTENDSELECT   \
;   || (syv)==SYV_UNDO           \
;   || (syv)==SYV_COPY           \
;   || (syv)==SYV_CUT            \
;   || (syv)==SYV_PASTE          \
;   || (syv)==SYV_CLEARWORD      \
;   || (syv)==SYV_KKCONVERT      \
;   || (syv)==SYV_USER           \
;   || (syv)==SYV_CORRECT        \
;   )

;FIsAnsiGesture(syv) \
;   (                            \
;   (syv) == SYV_BACKSPACE       \
;   || (syv) == SYV_TAB          \
;   || (syv) == SYV_RETURN       \
;   || (syv) == SYV_SPACE        \
;   )

;SubPenMsgFromWpLp(wp, lp)       (LOWORD(wp))
;EventRefFromWpLp(wp, lp)        (HIWORD(wp))
;TerminationFromWpLp(wp, lp)     ((int)HIWORD(wp))
;HpcmFromWpLp(wp, lp)            ((HPCM)(lp))

;HwndFromHtrg(htrg)      ((HWND)(DWORD)(htrg))
;HtrgFromHwnd(hwnd)      ((HTRG)(UINT)(hwnd))

struct ABSTIME
       sec dd ?
       ms dd ?
ends

struct CTLINITHEDIT
       cbSize dd ?
       pad1 dd ?
       hwnd dq ?
       id dd ?
       dwFlags dd ?
       dwReserved dd ?
       pad2 dd ?
ends

struct BOXLAYOUT
       cyCusp dd ?
       cyEndCusp dd ?
       style dd ?
       dwReserved1 dd ?
       dwReserved2 dd ?
       dwReserved3 dd ?
ends

struct CTLINITBEDIT
       cbSize dd ?
       pad1 dd ?
       hwnd dq ?
       id dd ?
       wSizeCategory dw ?
       wFlags dw ?
       dwReserved dd ?
       pad2 dd ?
ends

struct BOXEDITINFO
       cxBox dd ?
       cyBox dd ?
       cxBase dd ?
       cyBase dd ?
       cyMid dd ?
       boxlayout BOXLAYOUT
       wFlags dd ?
       szFaceName db BEI_FACESIZE dup(?)
       wFontHeight dd ?
       rgwReserved dd 8 dup(?)
ends

struct RECTOFS
       dLeft dd ?
       dTop dd ?
       dRight dd ?
       dBottom dd ?
ends

struct MSVCRTRECT
       left dd ?
       top dd ?
       right dd ?
       bottom dd ?
ends

struct PENDATAHEADER
       wVersion dd ?
       cbSizeUsed dd ?
       cStrokes dd ?
       cPnt dd ?
       cPntStrokeMax dd ?
       rectBound MSVCRTRECT
       wPndts dd ?
       nInkWidth dd ?
       rgbInk dd ?
ends

struct STROKEINFO
       cPnt dd ?
       cbPnts dd ?
       wPdk dd ?
       dwTick dd ?
ends

struct PENTIP
       cbSize dd ?
       btype db ?
       bwidth db ?
       bheight db ?
       bOpacity db ?
       rgb dd ?
       dwFlags dd ?
       dwReserved dd ?
ends

struct ANIMATEINFO
       cbSize dd ?
       uSpeedPct dd ?
       uPeriodCB dd ?
       fuFlags dd ?
       lParam dq ?
       dwReserved dd ?
       pad1 dd ?
ends

struct OEMPENINFO
       wPdt dd ?
       wValueMax dd ?
       wDistinct dd ?
ends

struct PENPACKET
       wTabletX dd ?
       wTabletY dd ?
       wPDK dd ?
       rgwOemData dd MAXOEMDATAWORDS dup(?)
ends

struct OEMPENPACKET
       wTabletX dd ?
       wTabletY dd ?
       wPDK dd ?
       rgwOemData dd MAXOEMDATAWORDS dup(?)
       dwTime dd ?
ends

struct PENINFO
       cxRawWidth dd ?
       cyRawHeight dd ?
       wDistinctWidth dd ?
       wDistinctHeight dd ?
       nSamplingRate dd ?
       nSamplingDist dd ?
       lPdc dd ?
       cPens dd ?
       cbOemData dd ? ;36
       rgoempeninfo OEMPENINFO ;12*6 = 72
		    db sizeof.OEMPENINFO * (MAXOEMDATAWORDS-1) dup(?)
       rgwReserved dd 7 dup(?) ;28
       fuOEM dd ?
ends

struct CALBSTRUCT
       wOffsetX dd ?
       wOffsetY dd ?
       wDistinctWidth dd ?
       wDistinctHeight dd ?
ends

struct INTERVAL
       atBegin ABSTIME
       atEnd ABSTIME
ends

struct BOXRESULTS
       indxBox dd ?
       pad1 dd ?
       hinksetBox dq ?
       rgSyv dd ?
       pad2 dd ?
ends

struct GUIDE
       xOrigin dd ?
       yOrigin dd ?
       cxBox dd ?
       cyBox dd ?
       cxBase dd ?
       cyBase dd ?
       cHorzBox dd ?
       cVertBox dd ?
       cyMid dd ?
ends

struct MSVCRTPOINT
       x dd ?
       y dd ?
ends

struct CTLINITIEDIT
       cbSize dd ?
       pad1 dd ?
       hwnd dq ?
       id dd ?
       ieb dw ?
       iedo dw ?
       iei dw ?
       ien dw ?
       ierec dw ?
       ies dw ?
       iesec dw ?
       pdts dw ?
       pad2 dd ?
       hpndt dq ?
       hgdiobj dq ?
       hpenGrid dq ?
       ptOrgGrid MSVCRTPOINT
       wVGrid dw ?
       wHGrid dw ?
       dwApp dd ?
       dwReserved dd ?
       pad3 dd ?
ends

struct PDEVENT
       cbSize dd ?
       pad1 dd ?
       hwnd dq ?
       wm dd ?
       pad2 dd ?
       wParam dq ?
       lParam dq ?
       pt MSVCRTPOINT
       fPen dd ?
       lExInfo dd ?
       dwReserved dd ?
       pad3 dd ?
ends

struct STRKFMT
       cbSize dd ?
       iesf dd ?
       iStrk dd ?
       tip PENTIP
       dwUser dd ?
       dwReserved dd ?
ends

struct PCMINFO
       cbSize dd ?
       dwPcm dd ?
       rectBound MSVCRTRECT
       rectExclude MSVCRTRECT
       hrgnBound dq ?
       hrgnExclude dq ?
       dwTimeout dd ?
       pad1 dd ?
ends

struct INKINGINFO
       cbSize dd ?
       wFlags dd ?
       tip PENTIP
       rectClip MSVCRTRECT
       rectInkStop MSVCRTRECT
       pad1 dd ?
       hrgnClip dq ?
       hrgnInkStop dq ?
ends

struct TARGET
       dwFlags dd ?
       idTarget dd ?
       htrgTarget dq ?
       rectBound MSVCRTRECT
       dwData dd ?
       rectBoundInk MSVCRTRECT
       rectBoundLastInk MSVCRTRECT
       pad1 dd ?
ends

struct TARGINFO
       cbSize dd ?
       dwFlags dd ?
       htrgOwner dq ?
       cTargets dw ?
       iTargetLast dw ?
       rgTarget TARGET
       pad1 dd ?
ends

struct INPPARAMS
       cbSize dd ?
       dwFlags dd ?
       hpndt dq ?
       target TARGET
ends

;struct tagCWX ;JAPAN
;       cbSize dd ?
;       wApplyFlags dw ?
;       hwndText dd ?
;       hrc dd ?
;       szCaption db CBCAPTIONCWX dup(?)
;       dwEditStyle dd ?
;       dwSel dd ?
;       dwFlags dd ?
;       ixkb dw ?
;       rgState dw CKBCWX dup(?)
;       ptUL POINT
;       sizeHW SIZE
;ends

INT8_MAX = 127
UINT8_MAX = $ff
BYTE_MAX = $ff
SHORT_MAX = 32767
INT16_MAX = 32767
USHORT_MAX = $ffff
UINT16_MAX = $ffff
WORD_MAX = $ffff
INT_MAX = 2147483647
INT32_MAX = 2147483647
UINT_MAX = $ffffffff
UINT32_MAX = $ffffffff
LONG_MAX = 2147483647
ULONG_MAX = $ffffffff
DWORD_MAX = $ffffffff
LONGLONG_MAX = 9223372036854775807
LONG64_MAX = 9223372036854775807
INT64_MAX = 9223372036854775807
ULONGLONG_MAX = $ffffffffffffffff
DWORDLONG_MAX = $ffffffffffffffff
ULONG64_MAX = $ffffffffffffffff
DWORD64_MAX = $ffffffffffffffff
UINT64_MAX = $ffffffffffffffff
INT128_MAX equ 170141183460469231731687303715884105727
UINT128_MAX equ $ffffffffffffffffffffffffffffffff
INT_PTR_MAX = 9223372036854775807
UINT_PTR_MAX = $ffffffffffffffff
LONG_PTR_MAX = 9223372036854775807
ULONG_PTR_MAX = $ffffffffffffffff
DWORD_PTR_MAX = $ffffffffffffffff
PTRDIFF_T_MAX = 9223372036854775807
SIZE_T_MAX = $ffffffffffffffff
SSIZE_T_MAX = 9223372036854775807
_SIZE_T_MAX = $ffffffffffffffff


;ole2.h, objbase.h, rpc.h, rpcndr.h, basetsd.h, rpcdce.h, specstrings.h, rpcdcep.h, rpcnsi.h,
;rpcnterr.h, rpcasync.h, basetsd.h, rpcnsip.h, unknwn.h, objidl.h, propidl.h, oaidl.h

;Microsoft Windows
;Copyright (c) Microsoft Corporation. All rights reserved.
;File:       OLE2.h
;Contents:   Main OLE2 header; Defines Linking and Emmebbeding interfaces, and API's.
;            Also includes .h files for the compobj, and oleauto  subcomponents.

;Microsoft Windows
;Copyright (c) Microsoft Corporation. All rights reserved.
;File:       objbase.h
;Contents:   Component object model defintions.

;Copyright (c) Microsoft Corporation. All rights reserved.
;Module Name: rpc.h
;Abstract: Master include file for RPC applications.

;Copyright (c) Microsoft Corporation.  All rights reserved.
;Module Name: basetsd.h
;Abstract: Type definitions for the basic sized types.

ADDRESS_TAG_BIT = $80000000

MAXUINT_PTR = not 0
MAXINT_PTR = (MAXUINT_PTR shr 1)
MININT_PTR = not MAXINT_PTR

MAXULONG_PTR = not 0
MAXLONG_PTR = (MAXULONG_PTR shr 1)
MINLONG_PTR = not MAXLONG_PTR

MAXUHALF_PTR = not 0
MAXHALF_PTR = (MAXUHALF_PTR shr 1)
MINHALF_PTR = not MAXHALF_PTR

;Copyright (c) Microsoft Corporation. All rights reserved.
;Module Name: rpcdce.h
;Abstract: This module contains the DCE RPC runtime APIs.

;SpecStrings.h - markers for documenting the semantics of APIs
;Version 1.0
;Copyright (c) Microsoft Corporation. All rights reserved.

struct RPCBINDINGVECTOR
       Count dd ?,?
       BindingH dq ?
ends

struct UUIDVECTOR
       Count dd ?,?
       Uuid dq ?
ends

struct RPCIFID
       Uuid GUID
       VersMajor dw ?
       VersMinor dw ?
ends

RPC_C_BINDING_INFINITE_TIMEOUT = 10
RPC_C_BINDING_MIN_TIMEOUT = 0
RPC_C_BINDING_DEFAULT_TIMEOUT = 5
RPC_C_BINDING_MAX_TIMEOUT = 9
RPC_C_CANCEL_INFINITE_TIMEOUT = -1
RPC_C_LISTEN_MAX_CALLS_DEFAULT = 1234
RPC_C_PROTSEQ_MAX_REQS_DEFAULT = 10
RPC_C_BIND_TO_ALL_NICS = 1
RPC_C_USE_INTERNET_PORT = 1
RPC_C_USE_INTRANET_PORT = 2
RPC_C_DONT_FAIL = 4
RPC_C_MQ_TEMPORARY = 0
RPC_C_MQ_PERMANENT = 1
RPC_C_MQ_CLEAR_ON_OPEN = 2
RPC_C_MQ_USE_EXISTING_SECURITY = 4
RPC_C_MQ_AUTHN_LEVEL_NONE = 0
RPC_C_MQ_AUTHN_LEVEL_PKT_INTEGRITY = 8
RPC_C_MQ_AUTHN_LEVEL_PKT_PRIVACY = $10
RPC_C_OPT_MQ_DELIVERY = 1
RPC_C_OPT_MQ_PRIORITY = 2
RPC_C_OPT_MQ_JOURNAL = 3
RPC_C_OPT_MQ_ACKNOWLEDGE = 4
RPC_C_OPT_MQ_AUTHN_SERVICE = 5
RPC_C_OPT_MQ_AUTHN_LEVEL = 6
RPC_C_OPT_MQ_TIME_TO_REACH_QUEUE = 7
RPC_C_OPT_MQ_TIME_TO_BE_RECEIVED = 8
RPC_C_OPT_BINDING_NONCAUSAL = 9
RPC_C_OPT_SECURITY_CALLBACK = 10
RPC_C_OPT_UNIQUE_BINDING = 11
RPC_C_OPT_CALL_TIMEOUT = 12
RPC_C_OPT_DONT_LINGER = 13
RPC_C_OPT_MAX_OPTIONS = 14
RPC_C_MQ_EXPRESS = 0
RPC_C_MQ_RECOVERABLE = 1
RPC_C_MQ_JOURNAL_NONE = 0
RPC_C_MQ_JOURNAL_DEADLETTER = 1
RPC_C_MQ_JOURNAL_ALWAYS = 2
RPC_C_FULL_CERT_CHAIN = 1

struct RPCPROTSEQVECTORA
       Count dd ?,?
       Protseq dq ?
ends

struct RPCPROTSEQVECTORW
       Count dd ?,?
       Protseq dq ?
ends

struct RPCPOLICY
       Length dd ?
       EndpointFlags dd ?
       NICFlags dd ?
ends

struct RPCSTATSVECTOR
       Count dd ?
       Stats dd ?
ends

RPC_C_STATS_CALLS_IN = 0
RPC_C_STATS_CALLS_OUT = 1
RPC_C_STATS_PKTS_IN = 2
RPC_C_STATS_PKTS_OUT = 3

struct RPCIFIDVECTOR
       Count dd ?,?
       IfId dq ?
ends

RPC_C_AUTHN_LEVEL_DEFAULT = 0
RPC_C_AUTHN_LEVEL_NONE = 1
RPC_C_AUTHN_LEVEL_CONNECT = 2
RPC_C_AUTHN_LEVEL_CALL = 3
RPC_C_AUTHN_LEVEL_PKT = 4
RPC_C_AUTHN_LEVEL_PKT_INTEGRITY = 5
RPC_C_AUTHN_LEVEL_PKT_PRIVACY = 6
RPC_C_IMP_LEVEL_DEFAULT = 0
RPC_C_IMP_LEVEL_ANONYMOUS = 1
RPC_C_IMP_LEVEL_IDENTIFY = 2
RPC_C_IMP_LEVEL_IMPERSONATE = 3
RPC_C_IMP_LEVEL_DELEGATE = 4
RPC_C_QOS_IDENTITY_STATIC = 0
RPC_C_QOS_IDENTITY_DYNAMIC = 1
RPC_C_QOS_CAPABILITIES_DEFAULT = 0
RPC_C_QOS_CAPABILITIES_MUTUAL_AUTH = 1
RPC_C_QOS_CAPABILITIES_MAKE_FULLSIC = 2
RPC_C_QOS_CAPABILITIES_ANY_AUTHORITY = 4
RPC_C_QOS_CAPABILITIES_IGNORE_DELEGATE_FAILURE = 8
RPC_C_QOS_CAPABILITIES_LOCAL_MA_HINT = $10
RPC_C_PROTECT_LEVEL_DEFAULT = (RPC_C_AUTHN_LEVEL_DEFAULT)
RPC_C_PROTECT_LEVEL_NONE = (RPC_C_AUTHN_LEVEL_NONE)
RPC_C_PROTECT_LEVEL_CONNECT = (RPC_C_AUTHN_LEVEL_CONNECT)
RPC_C_PROTECT_LEVEL_CALL = (RPC_C_AUTHN_LEVEL_CALL)
RPC_C_PROTECT_LEVEL_PKT = (RPC_C_AUTHN_LEVEL_PKT)
RPC_C_PROTECT_LEVEL_PKT_INTEGRITY = (RPC_C_AUTHN_LEVEL_PKT_INTEGRITY)
RPC_C_PROTECT_LEVEL_PKT_PRIVACY = (RPC_C_AUTHN_LEVEL_PKT_PRIVACY)
RPC_C_AUTHN_NONE = 0
RPC_C_AUTHN_DCE_PRIVATE = 1
RPC_C_AUTHN_DCE_PUBLIC = 2
RPC_C_AUTHN_DEC_PUBLIC = 4
RPC_C_AUTHN_GSS_NEGOTIATE = 9
RPC_C_AUTHN_WINNT = 10
RPC_C_AUTHN_GSS_SCHANNEL = 14
RPC_C_AUTHN_GSS_KERBEROS = 16
RPC_C_AUTHN_DPA = 17
RPC_C_AUTHN_MSN = 18
RPC_C_AUTHN_DIGEST = 21
RPC_C_AUTHN_MQ = 100
RPC_C_AUTHN_DEFAULT = $FFFFFFFF
RPC_C_NO_CREDENTIALS = MAXUINT_PTR
RPC_C_SECURITY_QOS_VERSION = 1
RPC_C_SECURITY_QOS_VERSION_1 = 1

struct RPCSECURITYQOS
       Version dd ?
       Capabilities dd ?
       IdentityTracking dd ?
       ImpersonationType dd ?
ends

SEC_WINNT_AUTH_IDENTITY_ANSI = 1
SEC_WINNT_AUTH_IDENTITY_UNICODE = 2

struct SECWINNTAUTHIDENTITYA
       User dq ?
       UserLength dd ?,?
       Domain dq ?
       DomainLength dd ?,?
       Password dq ?
       PasswordLength dd ?
       Flags dd ?
ends

struct SECWINNTAUTHIDENTITYW
       User dq ?
       UserLength dd ?,?
       Domain dq ?
       DomainLength dd ?,?
       Password dq ?
       PasswordLength dd ?
       Flags dd ?
ends

RPC_C_SECURITY_QOS_VERSION_2 = 2
RPC_C_AUTHN_INFO_TYPE_HTTP = 1
RPC_C_HTTP_AUTHN_TARGET_SERVER = 1
RPC_C_HTTP_AUTHN_TARGET_PROXY = 2
RPC_C_HTTP_AUTHN_SCHEME_BASIC = 1
RPC_C_HTTP_AUTHN_SCHEME_NTLM = 2
RPC_C_HTTP_AUTHN_SCHEME_PASSPORT = 4
RPC_C_HTTP_AUTHN_SCHEME_DIGEST = 8
RPC_C_HTTP_AUTHN_SCHEME_NEGOTIATE = $10
RPC_C_HTTP_AUTHN_SCHEME_CERT = $10000
RPC_C_HTTP_FLAG_USE_SSL = 1
RPC_C_HTTP_FLAG_USE_FIRST_AUTH_SCHEME = 2
RPC_C_HTTP_FLAG_IGNORE_CERT_CN_INVALID = 8

struct RPCHTTPTRANSPORTCREDENTIALSA
       TransportCredentials dq ?
       Flags dd ?
       AuthenticationTarget dd ?
       NumberOfAuthnSchemes dd ?,?
       AuthnSchemes dq ?
       ServerCertificateSubject dq ?
ends

struct RPCHTTPTRANSPORTCREDENTIALSW
       TransportCredentials dq ?
       Flags dd ?
       AuthenticationTarget dd ?
       NumberOfAuthnSchemes dd ?,?
       AuthnSchemes dq ?
       ServerCertificateSubject dq ?
ends

struct RPCSECURITYQOSV2A
       Version dd ?
       Capabilities dd ?
       IdentityTracking dd ?
       ImpersonationType dd ?
       AdditionalSecurityInfoType dd ?,?
       HttpCredentials dq ?
ends

struct RPCSECURITYQOSV2W
       Version dd ?
       Capabilities dd ?
       IdentityTracking dd ?
       ImpersonationType dd ?
       AdditionalSecurityInfoType dd ?,?
       HttpCredentials dq ?
ends

RPC_C_SECURITY_QOS_VERSION_3 = 3

struct RPCSECURITYQOSV3A
       Version dd ?
       Capabilities dd ?
       IdentityTracking dd ?
       ImpersonationType dd ?
       AdditionalSecurityInfoType dd ?,?
       HttpCredentials dq ?
       Sid dq ?
ends

struct RPCSECURITYQOSV3W
       Version dd ?
       Capabilities dd ?
       IdentityTracking dd ?
       ImpersonationType dd ?
       AdditionalSecurityInfoType dd ?,?
       HttpCredentials dq ?
       Sid dq ?
ends

RPCHTTP_RS_REDIRECT = 1
RPCHTTP_RS_ACCESS_1 = 2
RPCHTTP_RS_SESSION = 3
RPCHTTP_RS_ACCESS_2 = 4
RPCHTTP_RS_INTERFACE = 5

RPC_C_AUTHZ_NONE = 0
RPC_C_AUTHZ_NAME = 1
RPC_C_AUTHZ_DCE = 2
RPC_C_AUTHZ_DEFAULT = $ffffffff

RPC_C_EP_ALL_ELTS = 0
RPC_C_EP_MATCH_BY_IF = 1
RPC_C_EP_MATCH_BY_OBJ = 2
RPC_C_EP_MATCH_BY_BOTH = 3

RPC_C_VERS_ALL = 1
RPC_C_VERS_COMPATIBLE = 2
RPC_C_VERS_EXACT = 3
RPC_C_VERS_MAJOR_ONLY = 4
RPC_C_VERS_UPTO = 5

RPC_C_MGMT_INQ_IF_IDS = 0
RPC_C_MGMT_INQ_PRINC_NAME = 1
RPC_C_MGMT_INQ_STATS = 2
RPC_C_MGMT_IS_SERVER_LISTEN = 3
RPC_C_MGMT_STOP_SERVER_LISTEN = 4

RPC_C_PARM_MAX_PACKET_LENGTH = 1
RPC_C_PARM_BUFFER_LENGTH = 2

RPC_IF_AUTOLISTEN = 1
RPC_IF_OLE = 2
RPC_IF_ALLOW_UNKNOWN_AUTHORITY = 4
RPC_IF_ALLOW_SECURE_ONLY = 8
RPC_IF_ALLOW_CALLBACKS_WITH_NO_AUTH = $10
RPC_IF_ALLOW_LOCAL_ONLY = $20
RPC_IF_SEC_NO_CACHE = $40

struct RPCVERSION
       MajorVersion dw ?
       MinorVersion dw ?
ends

struct RPCSYNTAXIDENTIFIER
       SyntaxGUID GUID
       SyntaxVersion RPCVERSION
ends

struct RPCMESSAGE
       Handle dq ?
       DataRepresentation dd ?,?
       Buffer dq ?
       BufferLength dd ?
       ProcNum dd ?
       TransferSyntax dq ?
       RpcInterfaceInformation dq ?
       ReservedForRuntime dq ?
       ManagerEpv dq ?
       ImportContext dq ?
       RpcFlags dd ?,?
ends

PROTOCOL_NOT_LOADED = 1
PROTOCOL_LOADED = 2
PROTOCOL_ADDRESS_CHANGE = 3

RPC_CONTEXT_HANDLE_DEFAULT_GUARD = -4083
RPC_CONTEXT_HANDLE_DEFAULT_FLAGS = 0
RPC_CONTEXT_HANDLE_FLAGS = $30000000
RPC_CONTEXT_HANDLE_SERIALIZE = $10000000
RPC_CONTEXT_HANDLE_DONT_SERIALIZE = $20000000

RPC_NCA_FLAGS_DEFAULT = 0
RPC_NCA_FLAGS_IDEMPOTENT = 1
RPC_NCA_FLAGS_BROADCAST = 2
RPC_NCA_FLAGS_MAYBE = 4

RPC_BUFFER_COMPLETE = $1000
RPC_BUFFER_PARTIAL = $2000
RPC_BUFFER_EXTRA = $4000
RPC_BUFFER_ASYNC = $8000
RPC_BUFFER_NONOTIFY = $10000

RPCFLG_MESSAGE = $1000000
RPCFLG_AUTO_COMPLETE = $8000000
RPCFLG_LOCAL_CALL = $10000000
RPCFLG_INPUT_SYNCHRONOUS = $20000000
RPCFLG_ASYNCHRONOUS = $40000000
RPCFLG_NON_NDR = $80000000

RPCFLG_HAS_MULTI_SYNTAXES = $2000000
RPCFLG_HAS_CALLBACK = $4000000

RPC_FLAGS_VALID_BIT = $8000

struct RPCDISPATCHTABLE
       DispatchTableCount dd ?,?
       DispatchTable dq ?
       Reserved dq ?
ends

struct RPCPROTSEQENDPOINT
       RpcProtocolSequence dq ?
       Endpoint dq ?
ends

NT351_INTERFACE_SIZE = $40
RPC_INTERFACE_HAS_PIPES = 1

struct RPCSERVERINTERFACE
       Length dd ?
       InterfaceId RPCSYNTAXIDENTIFIER
       TransferSyntax RPCSYNTAXIDENTIFIER
       dd ?
       DispatchTable dq ?
       RpcProtseqEndpointCount dd ?,?
       RpcProtseqEndpoint dq ?
       DefaultManagerEpv dq ?
       InterpreterInfo dq ?
       Flags dd ?,?
ends

struct RPCCLIENTINTERFACE
       Length dd ?
       InterfaceId RPCSYNTAXIDENTIFIER
       TransferSyntax RPCSYNTAXIDENTIFIER
       dd ?
       DispatchTable dq ?
       RpcProtseqEndpointCount dd ?,?
       RpcProtseqEndpoint dq ?
       Reserved dq ?
       InterpreterInfo dq ?
       Flags dd ?,?
ends

TRANSPORT_TYPE_CN = 1
TRANSPORT_TYPE_DG = 2
TRANSPORT_TYPE_LPC = 4
TRANSPORT_TYPE_WMSG = 8

struct RPCTRANSFERSYNTAX
       Uuid GUID
       VersMajor dw ?
       VersMinor dw ?
ends

RPC_P_ADDR_FORMAT_TCP_IPV4 = 1
RPC_P_ADDR_FORMAT_TCP_IPV6 = 2

struct RPCCOPTMETADATADESCRIPTOR
       BufferSize dd ?,?
       Buffer dq ?
ends

struct RDRCALLOUTSTATE
       LastError dd ?,?
       LastEEInfo dq ?
       LastCalledStage dd ?,?
       ServerName dq ?
       ServerPort dq ?
       RemoteUser dq ?
       AuthType dq ?
       ResourceTypePresent db ?
       MetadataPresent db ?
       SessionIdPresent db ?
       InterfacePresent db ?
       ResourceType GUID
       SessionId GUID
       Interface RPCSYNTAXIDENTIFIER
       CertContext dq ?
ends

struct IRPCPROXYCALLBACKINTERFACE
       I_RpcProxyIsValidMachineFn dq ?
       I_RpcProxyGetClientAddressFn dq ?
       I_RpcProxyGetConnectionTimeoutFn dq ?
       I_RpcPerformCalloutFn dq ?
       I_RpcFreeCalloutStateFn dq ?
       I_RpcProxyGetClientSessionAndResourceUUID dq ?
       I_RpcProxyFilterIfFn dq ?
       I_RpcProxyUpdatePerfCounterFn dq ?
       I_RpcProxyUpdatePerfCounterBackendServerFn dq ?
ends

RPC_PROXY_CONNECTION_TYPE_IN_PROXY = 0
RPC_PROXY_CONNECTION_TYPE_OUT_PROXY = 1

;Copyright (c) Microsoft Corporation. All rights reserved.
;Module Name:  rpcnsi.h
;Abstract: This file contains the types and function definitions to use the
;          Name Service Independent APIs.
RPC_C_NS_SYNTAX_DEFAULT = 0
RPC_C_NS_SYNTAX_DCE = 3
RPC_C_PROFILE_DEFAULT_ELT = 0
RPC_C_PROFILE_ALL_ELT = 1
RPC_C_PROFILE_ALL_ELTS = RPC_C_PROFILE_ALL_ELT
RPC_C_PROFILE_MATCH_BY_IF = 2
RPC_C_PROFILE_MATCH_BY_MBR = 3
RPC_C_PROFILE_MATCH_BY_BOTH = 4
RPC_C_NS_DEFAULT_EXP_AGE = -1

RPC_S_OK = ERROR_SUCCESS
RPC_S_INVALID_ARG = ERROR_INVALID_PARAMETER
RPC_S_OUT_OF_MEMORY = ERROR_OUTOFMEMORY
RPC_S_OUT_OF_THREADS = ERROR_MAX_THRDS_REACHED
RPC_S_INVALID_LEVEL  = ERROR_INVALID_PARAMETER
RPC_S_BUFFER_TOO_SMALL = ERROR_INSUFFICIENT_BUFFER
RPC_S_INVALID_SECURITY_DESC = ERROR_INVALID_SECURITY_DESCR
RPC_S_ACCESS_DENIED = ERROR_ACCESS_DENIED
RPC_S_SERVER_OUT_OF_MEMORY = ERROR_NOT_ENOUGH_SERVER_MEMORY
RPC_S_ASYNC_CALL_PENDING = ERROR_IO_PENDING
RPC_S_UNKNOWN_PRINCIPAL = ERROR_NONE_MAPPED
RPC_S_TIMEOUT = ERROR_TIMEOUT

RPC_X_NO_MEMORY = RPC_S_OUT_OF_MEMORY
RPC_X_INVALID_BOUND = RPC_S_INVALID_BOUND
RPC_X_INVALID_TAG = RPC_S_INVALID_TAG
RPC_X_ENUM_VALUE_TOO_LARGE = RPC_X_ENUM_VALUE_OUT_OF_RANGE
RPC_X_SS_CONTEXT_MISMATCH = ERROR_INVALID_HANDLE
RPC_X_INVALID_BUFFER = ERROR_INVALID_USER_BUFFER
RPC_X_PIPE_APP_MEMORY = ERROR_OUTOFMEMORY
RPC_X_INVALID_PIPE_OPERATION = RPC_X_WRONG_PIPE_ORDER

;Copyright (c) Microsoft Corporation. All rights reserved.
;Module Name:  rpcasync.h
;Abstract: This module contains the RPC runtime APIs needed to use [async] RPC features.
RPC_ASYNC_VERSION_1_0 = sizeof.RPCASYNCSTATE

RpcNotificationTypeNone = 0
RpcNotificationTypeEvent = 1
RpcNotificationTypeApc = 2
RpcNotificationTypeIoc = 3
RpcNotificationTypeHwnd = 4
RpcNotificationTypeCallback = 5

RpcCallComplete = 0
RpcSendComplete = 1
RpcReceiveComplete = 2

struct RPCASYNCNOTIFICATIONINFO
       union
	   struct
		IONotificationRoutine dq ?
		hThread dq ?
	   ends

	   struct
		hIOPort dq ?
		dwNumberOfBytesTransferred dd ?,?
		dwCompletionKey dq ?
		lpOverlapped dq ?
	   ends

	   struct
		hWnd dq ?
		Msg dd ?,?
	   ends
	   union
		hEvent dq ?
		Event dq ?
	   ends

	   NotificationRoutine dq ?
       ends
ends

struct RPCASYNCSTATE
       Size dd ?
       Signature dd ?
       Lock dd ?
       Flags dd ?
       StubInfo dq ?
       UserInfo dq ?
       RuntimeInfo dq ?
       Event dd ?
       NotificationType dd ?
       u  RPCASYNCNOTIFICATIONINFO
       Reserved dq ?,?,?,?
ends

RPC_C_NOTIFY_ON_SEND_COMPLETE = 1
RPC_C_INFINITE_TIMEOUT = INFINITE

eeptAnsiString = 1
eeptUnicodeString = 2
eeptLongVal = 3
eeptShortVal = 4
eeptPointerVal = 5
eeptNone = 6
eeptBinary = 7

MaxNumberOfEEInfoParams = 4
RPC_EEINFO_VERSION = 1

struct BINARYPARAM
       Buffer dq ?
       Size dw ?,?,?,?
ends

struct RPCEEINFOPARAM
       ParameterType dd ?,?
       union
	   AnsiString dq ?
	   UnicodeString dq ?
	   LVal dd ?
	   SVal dw ?
	   PVal dq ?
	   BVal BINARYPARAM
       ends
ends

EEInfoPreviousRecordsMissing = 1
EEInfoNextRecordsMissing = 2
EEInfoUseFileTime = 4
EEInfoGCCOM = 11
EEInfoGCFRS = 12

struct RPCEXTENDEDERRORINFO
       Version dd ?,?
       ComputerName dq ?
       ProcessID dd ?,?
       union
	   SystemTime SYSTEMTIME
	   FileTime FILETIME
	   KernelTime dq ?
       ends
       GeneratingComponent dd ?
       Status dd ?
       DetectionLocation dw ?
       Flags dw ?
       NumberOfParameters dd ?
       Parameters RPCEEINFOPARAM
		  db sizeof.RPCEEINFOPARAM * (MaxNumberOfEEInfoParams-1) dup(?)
ends

struct RPCERRORENUMHANDLE
       Signature dd ?,?
       CurrentPos dq ?
       Head dq ?
ends

RPC_CALL_ATTRIBUTES_VERSION = 1
RPC_QUERY_SERVER_PRINCIPAL_NAME = 2
RPC_QUERY_CLIENT_PRINCIPAL_NAME = 4

struct RPCCALLATTRIBUTESV1W
       Version dd ?
       Flags dd ?
       ServerPrincipalNameBufferLength dd ?,?
       ServerPrincipalName dq ?
       ClientPrincipalNameBufferLength dd ?,?
       ClientPrincipalName dq ?
       AuthenticationLevel dd ?
       AuthenticationService dd ?
       NullSession dd ?,?
ends

struct RPCCALLATTRIBUTESV1A
       Version dd ?
       Flags dd ?
       ServerPrincipalNameBufferLength dd ?,?
       ServerPrincipalName dq ?
       ClientPrincipalNameBufferLength dd ?,?
       ClientPrincipalName dq ?
       AuthenticationLevel dd ?
       AuthenticationService dd ?
       NullSession dd ?,?
ends

;Copyright (c) Microsoft Corporation. All rights reserved.
;Module Name:  rpcndr.h
;Abstract:  Definitions for stub data structures and prototypes of helper functions.

;Copyright (c) Microsoft Corporation.  All rights reserved.
;Module Name:  basetsd.h
;Abstract:  Type definitions for the basic sized types.

ADDRESS_TAG_BIT = $80000000

MAXUINT_PTR  = not 0
MAXINT_PTR   = MAXUINT_PTR shr 1
MININT_PTR   = not MAXINT_PTR

MAXULONG_PTR = not 0
MAXLONG_PTR  = MAXULONG_PTR shr 1
MINLONG_PTR  = not MAXLONG_PTR

MAXUHALF_PTR = not 0
MAXHALF_PTR  = MAXUHALF_PTR shr 1
MINHALF_PTR  = not MAXHALF_PTR

;Copyright (c) Microsoft Corporation. All rights reserved.
;Module Name:  rpcnsip.h
;Abstract:  This file contains the types and function definitions to use the
;           to implement the autohandle features of the runtime.

struct RPCIMPORTCONTEXTP
       LookupContext dq ?
       ProposedHandle dq ?
       Bindings dq ?
ends

NDR_CHAR_REP_MASK = $F
NDR_INT_REP_MASK = $F0
NDR_FLOAT_REP_MASK = $FF00
NDR_LITTLE_ENDIAN = $10
NDR_BIG_ENDIAN = 0
NDR_IEEE_FLOAT = 0
NDR_VAX_FLOAT = $100
NDR_IBM_FLOAT = $300
NDR_ASCII_CHAR = 0
NDR_EBCDIC_CHAR = 1
NDR_LOCAL_DATA_REPRESENTATION = $10
NDR_LOCAL_ENDIAN = NDR_LITTLE_ENDIAN

struct NDRSCONTEXT
       pad dd ?,?
       userContext dd ?
ends

cbNDRContext = 20

struct ARRAYINFO
       Dimension dd ?,?
       BufferConformanceMark dq ?
       BufferVarianceMark dq ?
       MaxCountArray dq ?
       OffsetArray dq ?
       ActualCountArray dq ?
ends

struct CSSTUBINFO
       WireCodeset dd ?
       DesiredReceivingCodeset dd ?
       CSArrayInfo dd ?
ends

struct MIDLSTUBMESSAGE
       RpcMsg dq ?
       Buffer dq ?
       BufferStart dq ?
       BufferEnd dq ?
       BufferMark dq ?
       BufferLength dd ?
       MemorySize dd ?
       Memory dq ?
       IsClient db ?
       Pad db ?
       uFlags2 dw ?
       ReuseBuffer dd ?
       pAllocAllNodesContext dq ?
       pPointerQueueState dq ?
       IgnoreEmbeddedPointers dd ?,?
       PointerBufferMark dq ?
       CorrDespIncrement db ?
       uFlags db ?
       UniquePtrCount dw ?,?,?
       MaxCount dq ?
       Offset dd ?
       ActualCount dd ?
       pfnAllocate dq ?
       pfnFree dq ?
       StackTop dq ?
       pPresentedType dq ?
       pTransmitType dq ?
       SavedHandle dq ?
       StubDesc dq ?
       FullPtrXlatTables dq ?
       FullPtrRefId dd ?
       PointerLength dd ?
       union
	   fInDontFree dd ?
	   fDontCallFreeInst dd ?
	   fInOnlyParam dd ?
	   fHasReturn dd ?
	   fHasExtensions dd ?
	   fHasNewCorrDesc dd ?
	   fIsIn dd ?
	   fIsOut dd ?
	   fIsOicf dd ?
	   fBufferValid dd ?
	   fHasMemoryValidateCallback dd ?
	   fInFree dd ?
	   fNeedMCCP dd ?
	   fUnused dd ?
	   fUnused2 dd ?
       ends
       dwDestContext dd ?,?
       pvDestContext dq ?
       SavedContextHandles dq ?
       ParamNumber dd ?,?
       pRpcChannelBuffer dq ?
       pArrayInfo dq ?
       SizePtrCountArray dq ?
       SizePtrOffsetArray dq ?
       SizePtrLengthArray dq ?
       pArgQueue dq ?
       dwStubPhase dd ?
       LowStackMark dq ?
       pAsyncMsg dq ?
       pCorrInfo dq ?
       pCorrMemory dq ?
       pMemoryList dq ?
       pCSInfo dq ?
       ConformanceMark dq ?
       VarianceMark dq ?
       Unused dq ?
       pContext dq ?
       ContextHandleHash dq ?
       pUserMarshalList dq ?
       Reserved51_3 dq ?
       Reserved51_4 dq ?
       Reserved51_5 dq ?
ends

struct GENERICBINDINGROUTINEPAIR
       pfnBind dq ?
       pfnUnbind dq ?
ends

struct GENERICBINDINGINFO
       pObj dq ?
       Size dd ?,?
       pfnBind dq ?
       pfnUnbind dq ?
ends

struct XMITROUTINEQUINTUPLE
       pfnTranslateToXmit dq ?
       pfnTranslateFromXmit dq ?
       pfnFreeXmit dq ?
       pfnFreeInst dq ?
ends

struct USERMARSHALROUTINEQUADRUPLE
       pfnBufferSize dq ?
       pfnMarshall dq ?
       pfnUnmarshall dq ?
       pfnFree dq ?
ends

USER_MARSHAL_CB_SIGNATURE equ 'USRC'

USER_MARSHAL_CB_BUFFER_SIZE = 0
USER_MARSHAL_CB_MARSHALL = 1
USER_MARSHAL_CB_UNMARSHALL = 2
USER_MARSHAL_CB_FREE = 3

struct USERMARSHALCB
       Flags dd ?,?
       pStubMsg dq ?
       pReserve dq ?
       Signature dd ?
       CBType dd ?
       pFormat dq ?
       pTypeFormat dq ?
ends

USER_CALL_IS_ASYNC = $100
USER_CALL_NEW_CORRELATION_DESC = $200

struct MALLOCFREESTRUCT
       pfnAllocate dq ?
       pfnFree dq ?
ends

struct COMMFAULTOFFSETS
       CommOffset dw ?
       FaultOffset dw ?
ends

IDL_CS_NO_CONVERT = 0
IDL_CS_IN_PLACE_CONVERT = 1
IDL_CS_NEW_BUFFER_CONVERT = 2

struct NDRCSSIZECONVERTROUTINES
       pfnNetSize dq ?
       pfnToNetCs dq ?
       pfnLocalSize dq ?
       pfnFromNetCs dq ?
ends

struct NDRCSROUTINES
       pSizeConvertRoutines dq ?
       pTagGettingRoutines dq ?
ends

struct MIDLSTUBDESC
       RpcInterfaceInformation dq ?
       pfnAllocate dq ?
       pfnFree dq ?
       union
	   pAutoHandle dq ?
	   pPrimitiveHandle dq ?
	   pGenericBindingInfo dq ?
       ends
       apfnNdrRundownRoutines dq ?
       aGenericBindingRoutinePairs dq ?
       apfnExprEval dq ?
       aXmitQuintuple dq ?
       pFormatTypes dq ?
       fCheckBounds dd ?
       Version dd ?
       pMallocFreeStruct dq ?
       MIDLVersion dd ?,?
       CommFaultOffsets dq ?
       aUserMarshalQuadruple dq ?
       NotifyRoutineTable dq ?
       mFlags dd ?,?
       CsRoutineTables dq ?
       ProxyServerInfo dq ?
       pExprInfo dq ?
ends

struct MIDLSERVERINFO
       pStubDesc dq ?
       DispatchTable dq ?
       ProcString dq ?
       FmtStringOffset dq ?
       ThunkTable dq ?
       pTransferSyntax dq ?
       nCount dq ?
       pSyntaxInfo dq ?
ends

struct MIDLSTUBLESSPROXYINFO
       pStubDesc dq ?
       ProcFormatString dq ?
       FormatStringOffset dq ?
       pTransferSyntax dq ?
       nCount dq ?
       pSyntaxInfo dq ?
ends

struct MIDLSYNTAXINFO
       TransferSyntax RPCSYNTAXIDENTIFIER
       dd ?
       DispatchTable dq ?
       ProcString dq ?
       FmtStringOffset dq ?
       TypeString dq ?
       aUserMarshalQuadruple dq ?
       pReserved1 dq ?
       pReserved2 dq ?
ends

struct CLIENTCALLRETURN
       union
	   Pointer dq ?
	   Simple dq ?
       ends
ends

XLAT_SERVER = 1
XLAT_CLIENT = 2

struct FULLPTRXLATTABLES
       RefIdToPointer dq ?
       PointerToRefId dq ?
       NextRefId dd ?
       XlatSide dd ?
ends

USER_MARSHAL_FC_BYTE = 1
USER_MARSHAL_FC_CHAR = 2
USER_MARSHAL_FC_SMALL = 3
USER_MARSHAL_FC_USMALL = 4
USER_MARSHAL_FC_WCHAR = 5
USER_MARSHAL_FC_SHORT = 6
USER_MARSHAL_FC_USHORT = 7
USER_MARSHAL_FC_LONG = 8
USER_MARSHAL_FC_ULONG = 9
USER_MARSHAL_FC_FLOAT = 10
USER_MARSHAL_FC_HYPER = 11
USER_MARSHAL_FC_DOUBLE = 12

STUB_UNMARSHAL = 0
STUB_CALL_SERVER = 1
STUB_MARSHAL = 2
STUB_CALL_SERVER_NO_HRESULT = 3

PROXY_CALCSIZE = 0
PROXY_GETBUFFER = 1
PROXY_MARSHAL = 2
PROXY_SENDRECEIVE = 3
PROXY_UNMARSHAL = 4

struct NDRUSERMARSHALINFOLEVEL1
       Buffer dq ?
       BufferSize dd ?,?
       pfnAllocate dq ?
       pfnFree dq ?
       pRpcChannelBuffer dq ?
       Reserved dq 5 dup(?)
ends

struct NDRUSERMARSHALINFO
       InformationLevel dd ?,?
       Level1 NDRUSERMARSHALINFOLEVEL1
ends

CLSCTX_INPROC = CLSCTX_INPROC_SERVER or CLSCTX_INPROC_HANDLER
CLSCTX_ALL = (CLSCTX_INPROC_SERVER or CLSCTX_INPROC_HANDLER or CLSCTX_LOCAL_SERVER or\
	      CLSCTX_REMOTE_SERVER)
CLSCTX_SERVER = (CLSCTX_INPROC_SERVER or CLSCTX_LOCAL_SERVER or CLSCTX_REMOTE_SERVER)

REGCLS_SINGLEUSE = 0
REGCLS_MULTIPLEUSE = 1
REGCLS_MULTI_SEPARATE = 2
REGCLS_SUSPENDED = 4
REGCLS_SURROGATE = 8

MARSHALINTERFACE_MIN = 500
CWCSTORAGENAME = 32

STGM_DIRECT = 0
STGM_TRANSACTED = $10000
STGM_SIMPLE = $8000000
STGM_READ = 0
STGM_WRITE = 1
STGM_READWRITE = 2
STGM_SHARE_DENY_NONE = $40
STGM_SHARE_DENY_READ = $30
STGM_SHARE_DENY_WRITE = $20
STGM_SHARE_EXCLUSIVE = $10
STGM_PRIORITY = $40000
STGM_DELETEONRELEASE = $4000000
STGM_NOSCRATCH = $100000
STGM_CREATE = $1000
STGM_CONVERT = $20000
STGM_FAILIFTHERE = 0
STGM_NOSNAPSHOT = $200000
STGM_DIRECT_SWMR = $400000

ASYNC_MODE_COMPATIBILITY = 1
ASYNC_MODE_DEFAULT = 0
STGTY_REPEAT = $100
STG_TOEND = $FFFFFFFF
STG_LAYOUT_SEQUENTIAL = 0
STG_LAYOUT_INTERLEAVED = 1

STGFMT_STORAGE = 0
STGFMT_NATIVE = 1
STGFMT_FILE = 3
STGFMT_ANY = 4
STGFMT_DOCFILE = 5
STGFMT_DOCUMENT = 0

;IID_IUnknown GUID $00000000,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IUnknown,\
	  QueryInterface,\
	  AddRef,\
	  Release

;IID_AsyncIUnknown GUID $000e0000,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface AsyncIUnknown,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Begin_QueryInterface,\
	  Finish_QueryInterface,\
	  Begin_AddRef,\
	  Finish_AddRef,\
	  Begin_Release,\
	  Finish_Release

;IID_IClassFactory GUID $00000001,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IClassFactory,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  CreateInstance,\
	  LockServer

struct COSERVERINFO
       dwReserved1 dd ?,?
       pwszName dq ?
       pAuthInfo dq ?
       dwReserved2 dd ?,?
ends

;IID_IMarshal GUID $00000003,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IMarshal,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetUnmarshalClass,\
	  GetMarshalSizeMax,\
	  MarshalInterface,\
	  UnmarshalInterface,\
	  ReleaseMarshalData,\
	  DisconnectObject

;IID_IMarshal2 GUID $000001cf,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IMarshal2,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetUnmarshalClass,\
	  GetMarshalSizeMax,\
	  MarshalInterface,\
	  UnmarshalInterface,\
	  ReleaseMarshalData,\
	  DisconnectObject

;IID_IMalloc GUID $00000002,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IMalloc,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Alloc,\
	  Realloc,\
	  Free,\
	  GetSize,\
	  DidAlloc,\
	  HeapMinimize

;IID_IMallocSpy GUID $0000001d,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IMallocSpy,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  PreAlloc,\
	  PostAlloc,\
	  PreFree,\
	  PostFree,\
	  PreRealloc,\
	  PostRealloc,\
	  PreGetSize,\
	  PostGetSize,\
	  PreDidAlloc,\
	  PostDidAlloc,\
	  PreHeapMinimize,\
	  PostHeapMinimize

;IID_IStdMarshalInfo GUID $00000018,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IStdMarshalInfo,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetClassForHandler

EXTCONN_STRONG = 1
EXTCONN_WEAK = 2
EXTCONN_CALLABLE = 4

;IID_IExternalConnection GUID $00000019,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IExternalConnection,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  AddConnection,\
	  ReleaseConnection

struct MULTIQI
       pIID dq ?
       pItf dq ?
       hr dd ?,?
ends

;IID_IMultiQI GUID $00000020,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IMultiQI,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  QueryMultipleInterfaces

;IID_AsyncIMultiQI GUID $000e0020,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface AsyncIMultiQI,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Begin_QueryMultipleInterfaces,\
	  Finish_QueryMultipleInterfaces

;IID_IInternalUnknown GUID $00000021,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IInternalUnknown,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  QueryInternalInterface

;IID_IEnumUnknown GUID $00000100,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IEnumUnknown,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Next,\
	  Skip,\
	  Reset,\
	  Clone

struct BINDOPTS
       cbStruct dd ?
       grfFlags dd ?
       grfMode dd ?
       dwTickCountDeadline dd ?
ends

struct BINDOPTS2
       cbStruct dd ?
       grfFlags dd ?
       grfMode dd ?
       dwTickCountDeadline dd ?
       dwTrackFlags dd ?
       dwClassContext dd ?
       locale dd ?,?
       pServerInfo dq ?
ends

BIND_MAYBOTHERUSER = 1
BIND_JUSTTESTEXISTENCE = 2

;IID_IBindCtx GUID $0000000e,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IBindCtx,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  RegisterObjectBound,\
	  RevokeObjectBound,\
	  ReleaseBoundObjects,\
	  SetBindOptions,\
	  GetBindOptions,\
	  GetRunningObjectTable,\
	  RegisterObjectParam,\
	  GetObjectParam,\
	  EnumObjectParam,\
	  RevokeObjectParam

;IID_IEnumMoniker GUID $00000102,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IEnumMoniker,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Next,\
	  Skip,\
	  Reset,\
	  Clone

;IID_IRunnableObject GUID $00000126,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IRunnableObject,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetRunningClass,\
	  Run,\
	  IsRunning,\
	  LockRunning,\
	  SetContainedObject

;IID_IRunningObjectTable GUID $00000010,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IRunningObjectTable,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Register,\
	  Revoke,\
	  IsRunning,\
	  GetObject,\
	  NoteChangeTime,\
	  GetTimeOfLastChange,\
	  EnumRunning

;IID_IPersist GUID $0000010c,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IPersist,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetClassID

;IID_IPersistStream GUID $00000109,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IPersistStream,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetClassID,\
	  IsDirty,\
	  Load,\
	  Save,\
	  GetSizeMax

MKSYS_NONE = 0
MKSYS_GENERICCOMPOSITE = 1
MKSYS_FILEMONIKER = 2
MKSYS_ANTIMONIKER = 3
MKSYS_ITEMMONIKER = 4
MKSYS_POINTERMONIKER = 5
MKSYS_CLASSMONIKER = 7
MKSYS_OBJREFMONIKER = 8
MKSYS_SESSIONMONIKER = 9

MKRREDUCE_ONE = 3 shl 16
MKRREDUCE_TOUSER = 2 shl 16
MKRREDUCE_THROUGHUSER = 1 shl 16
MKRREDUCE_ALL = 0

;IID_IMoniker GUID $0000000f,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IMoniker,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetClassID,\
	  IsDirty,\
	  Load,\
	  Save,\
	  GetSizeMax,\
	  BindToObject,\
	  BindToStorage,\
	  Reduce,\
	  ComposeWith,\
	  Enum,\
	  IsEqual,\
	  Hash,\
	  IsRunning,\
	  GetTimeOfLastChange,\
	  Inverse,\
	  CommonPrefixWith,\
	  RelativePathTo,\
	  GetDisplayName,\
	  ParseDisplayName,\
	  IsSystemMoniker

;IID_IROTData GUID $f29f6bc0,$5021,$11ce,<$aa,$15,$00,$00,$69,$01,$29,$3f>
interface IROTData,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetComparisonData

;IID_IEnumString GUID $00000101,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IEnumString,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Next,\
	  Skip,\
	  Reset,\
	  Clone

;IID_ISequentialStream GUID $0c733a30,$2a1c,$11ce,<$ad,$e5,$00,$aa,$00,$44,$77,$3d>
interface ISequentialStream,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Read,\
	  Write

struct STATSTG
       pwcsName dq ?
       type dd ?,?
       cbSize dq ?
       mtime FILETIME
       ctime FILETIME
       atime FILETIME
       grfMode dd ?
       grfLocksSupported dd ?
       clsid GUID
       grfStateBits dd ?
       reserved dd ?
ends

STGTY_STORAGE = 1
STGTY_STREAM = 2
STGTY_LOCKBYTES = 3
STGTY_PROPERTY = 4

STREAM_SEEK_SET = 0
STREAM_SEEK_CUR = 1
STREAM_SEEK_END = 2

LOCK_WRITE = 1
LOCK_EXCLUSIVE = 2
LOCK_ONLYONCE = 4

;IID_IStream GUID $0000000c,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IStream,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Read,\
	  Write,\
	  Seek,\
	  SetSize,\
	  CopyTo,\
	  Commit,\
	  Revert,\
	  LockRegion,\
	  UnlockRegion,\
	  Stat,\
	  Clone

;IID_IEnumSTATSTG GUID $0000000d,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IEnumSTATSTG,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Next,\
	  Skip,\
	  Reset,\
	  Clone

;IID_IStorage GUID $0000000b,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IStorage,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  CreateStream,\
	  OpenStream,\
	  CreateStorage,\
	  OpenStorage,\
	  CopyTo,\
	  MoveElementTo,\
	  Commit,\
	  Revert,\
	  EnumElements,\
	  DestroyElement,\
	  RenameElement,\
	  SetElementTimes,\
	  SetClass,\
	  SetStateBits,\
	  Stat

struct REMSNB
       ulCntStr dd ?
       ulCntChar dd ?
       rgString dw ?,?
ends

;IID_IPersistFile GUID $0000010b,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IPersistFile,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetClassID,\
	  IsDirty,\
	  Load,\
	  Save,\
	  SaveCompleted,\
	  GetCurFile

;IID_IPersistStorage GUID $0000010a,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IPersistStorage,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetClassID,\
	  IsDirty,\
	  InitNew,\
	  Load,\
	  Save,\
	  SaveCompleted,\
	  HandsOffStorage

;IID_ILockBytes GUID $0000000a,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface ILockBytes,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  ReadAt,\
	  WriteAt,\
	  Flush,\
	  SetSize,\
	  LockRegion,\
	  UnlockRegion,\
	  Stat

struct DVTARGETDEVICE
       tdSize dd ?
       tdDriverNameOffset dw ?
       tdDeviceNameOffset dw ?
       tdPortNameOffset dw ?
       tdExtDevmodeOffset dw ?
       tdData db ?,?,?,?
ends

struct FORMATETC
       cfFormat dw ?,?,?,?
       ptd dq ?
       dwAspect dd ?
       lindex dd ?
       tymed dd ?,?
ends

;IID_IEnumFORMATETC GUID $00000103,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IEnumFORMATETC,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Next,\
	  Skip,\
	  Reset,\
	  Clone

ADVF_NODATA = 1
ADVF_PRIMEFIRST = 2
ADVF_ONLYONCE = 4
ADVF_DATAONSTOP = 64
ADVFCACHE_NOHANDLER = 8
ADVFCACHE_FORCEBUILTIN = 16
ADVFCACHE_ONSAVE = 32

struct STATDATA
       formatetc FORMATETC
       advf dd ?,?
       pAdvSink dq ?
       dwConnection dd ?,?
ends

;IID_IEnumSTATDATA GUID $00000105,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IEnumSTATDATA,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Next,\
	  Skip,\
	  Reset,\
	  Clone

;IID_IRootStorage GUID $00000012,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IRootStorage,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SwitchToFile

TYMED_HGLOBAL = 1
TYMED_FILE = 2
TYMED_ISTREAM = 4
TYMED_ISTORAGE = 8
TYMED_GDI = 16
TYMED_MFPICT = 32
TYMED_ENHMF = 64
TYMED_NULL = 0

struct REMSTGMEDIUM
       tymed dd ?
       dwHandleType dd ?
       pData dd ?
       pUnkForRelease dd ?
       cbData dd ?
       data db ?,?,?,?
ends

struct STGMEDIUM
       tymed dd ?,?
       union
	   hBitmap dq ?
	   hMetaFilePict dq ?
	   hEnhMetaFile dq ?
	   hGlobal dq ?
	   lpszFileName dq ?
	   pstm dq ?
	   pstg dq ?
       ends
       pUnkForRelease dq ?
ends

struct GDIOBJECT
       ObjectType dd ?,?
       union
	   hBitmap dq ?
	   hPalette dq ?
	   hGeneric dq ?
       ends
ends

struct FLAGSTGMEDIUM
       ContextFlags dd ?
       fPassOwnership dd ?
       Stgmed STGMEDIUM
ends

;IID_IAdviseSink GUID $0000010f,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IAdviseSink,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  OnDataChange,\
	  OnViewChange,\
	  OnRename,\
	  OnSave,\
	  OnClose

;IID_AsyncIAdviseSink GUID $00000150,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface AsyncIAdviseSink,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Begin_OnDataChange,\
	  Finish_OnDataChange,\
	  Begin_OnViewChange,\
	  Finish_OnViewChange,\
	  Begin_OnRename,\
	  Finish_OnRename,\
	  Begin_OnSave,\
	  Finish_OnSave,\
	  Begin_OnClose,\
	  Finish_OnClose

;IID_IAdviseSink2 GUID $00000125,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IAdviseSink2,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  OnDataChange,\
	  OnViewChange,\
	  OnRename,\
	  OnSave,\
	  OnClose,\
	  OnLinkSrcChange

;IID_AsyncIAdviseSink2 GUID $00000151,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface AsyncIAdviseSink2,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Begin_OnDataChange,\
	  Finish_OnDataChange,\
	  Begin_OnViewChange,\
	  Finish_OnViewChange,\
	  Begin_OnRename,\
	  Finish_OnRename,\
	  Begin_OnSave,\
	  Finish_OnSave,\
	  Begin_OnClose,\
	  Finish_OnClose,\
	  Begin_OnLinkSrcChange,\
	  Finish_OnLinkSrcChange

DATADIR_GET = 1
DATADIR_SET = 2

;IID_IDataObject GUID $0000010e,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IDataObject,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetData,\
	  GetDataHere,\
	  QueryGetData,\
	  GetCanonicalFormatEtc,\
	  SetData,\
	  EnumFormatEtc,\
	  DAdvise,\
	  DUnadvise,\
	  EnumDAdvise

;IID_IDataAdviseHolder GUID $00000110,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IDataAdviseHolder,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Advise,\
	  Unadvise,\
	  EnumAdvise,\
	  SendOnDataChange

CALLTYPE_TOPLEVEL = 1
CALLTYPE_NESTED = 2
CALLTYPE_ASYNC = 3
CALLTYPE_TOPLEVEL_CALLPENDING = 4
CALLTYPE_ASYNC_CALLPENDING = 5

SERVERCALL_ISHANDLED = 0
SERVERCALL_REJECTED = 1
SERVERCALL_RETRYLATER = 2

PENDINGTYPE_TOPLEVEL = 1
PENDINGTYPE_NESTED = 2

PENDINGMSG_CANCELCALL = 0
PENDINGMSG_WAITNOPROCESS = 1
PENDINGMSG_WAITDEFPROCESS = 2

struct OLEINTERFACEINFO
       pUnk dq ?
       iid GUID
       wMethod dw ?,?,?,?
ends

;IID_IMessageFilter GUID $00000016,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IMessageFilter,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  HandleInComingCall,\
	  RetryRejectedCall,\
	  MessagePending

struct RPCOLEMESSAGE
       reserved1 dq ?
       dataRepresentation dd ?,?
       Buffer dq ?
       cbBuffer dd ?
       iMethod dd ?
       reserved2 dq 5 dup(?)
       rpcFlags dd ?,?
ends

;IID_IRpcChannelBuffer GUID $D5F56B60,$593B,$101A,<$B5,$69,$08,$00,$2B,$2D,$BF,$7A>
interface IRpcChannelBuffer,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetBuffer,\
	  SendReceive,\
	  FreeBuffer,\
	  GetDestCtx,\
	  IsConnected

;IID_IRpcChannelBuffer2 GUID $594f31d0,$7f19,$11d0,<$b1,$94,$00,$a0,$c9,$0d,$c8,$bf>
interface IRpcChannelBuffer2,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetBuffer,\
	  SendReceive,\
	  FreeBuffer,\
	  GetDestCtx,\
	  IsConnected,\
	  GetProtocolVersion

;IID_IAsyncRpcChannelBuffer GUID $a5029fb6,$3c34,$11d1,<$9c,$99,$00,$c0,$4f,$b9,$98,$aa>
interface IAsyncRpcChannelBuffer,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetBuffer,\
	  SendReceive,\
	  FreeBuffer,\
	  GetDestCtx,\
	  IsConnected,\
	  GetProtocolVersion,\
	  Send,\
	  Receive,\
	  GetDestCtxEx

;IID_IRpcChannelBuffer3 GUID $25B15600,$0115,$11d0,<$BF,$0D,$00,$AA,$00,$B8,$DF,$D2>
interface IRpcChannelBuffer3,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetBuffer,\
	  SendReceive,\
	  FreeBuffer,\
	  GetDestCtx,\
	  IsConnected,\
	  GetProtocolVersion,\
	  Send,\
	  Receive,\
	  Cancel,\
	  GetCallContext,\
	  GetDestCtxEx,\
	  GetState,\
	  RegisterAsync

;IID_IRpcSyntaxNegotiate GUID $58a08519,$24c8,$4935,<$b4,$82,$3f,$d8,$23,$33,$3a,$4f>
interface IRpcSyntaxNegotiate,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  NegotiateSyntax

;IID_IRpcProxyBuffer GUID $D5F56A34,$593B,$101A,<$B5,$69,$08,$00,$2B,$2D,$BF,$7A>
interface IRpcProxyBuffer,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Connect,\
	  Disconnect

;IID_IRpcStubBuffer GUID $D5F56AFC,$593B,$101A,<$B5,$69,$08,$00,$2B,$2D,$BF,$7A>
interface IRpcStubBuffer,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Connect,\
	  Disconnect,\
	  Invoke,\
	  IsIIDSupported,\
	  CountRefs,\
	  DebugServerQueryInterface,\
	  DebugServerRelease

;IID_IPSFactoryBuffer GUID $D5F569D0,$593B,$101A,<$B5,$69,$08,$00,$2B,$2D,$BF,$7A>
interface IPSFactoryBuffer,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  CreateProxy,\
	  CreateStub

struct SCHANNELHOOKCALLINFO
       iid GUID
       cbSize dd ?
       uCausality GUID
       dwServerPid dd ?
       iMethod dd ?
       pObject dq ?
       dd ?
ends

;IID_IChannelHook GUID $1008c4a0,$7613,$11cf,<$9a,$f1,$00,$20,$af,$6e,$72,$f4>
interface IChannelHook,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  ClientGetSize,\
	  ClientFillBuffer,\
	  ClientNotify,\
	  ServerNotify,\
	  ServerGetSize,\
	  ServerFillBuffer

struct SOLEAUTHENTICATIONSERVICE
       dwAuthnSvc dd ?
       dwAuthzSvc dd ?
       pPrincipalName dq ?
       hr dd ?,?
ends

EOAC_NONE = 0
EOAC_MUTUAL_AUTH = 1
EOAC_STATIC_CLOAKING = $20
EOAC_DYNAMIC_CLOAKING = $40
EOAC_ANY_AUTHORITY = $80
EOAC_MAKE_FULLSIC = $100
EOAC_DEFAULT = $800
EOAC_SECURE_REFS = 2
EOAC_ACCESS_CONTROL = 4
EOAC_APPID = 8
EOAC_DYNAMIC = $10
EOAC_REQUIRE_FULLSIC = $200
EOAC_AUTO_IMPERSONATE = $400
EOAC_NO_CUSTOM_MARSHAL = $2000
EOAC_DISABLE_AAA = $1000

COLE_DEFAULT_PRINCIPAL = -1
COLE_DEFAULT_AUTHINFO = -1

struct SOLEAUTHENTICATIONINFO
       dwAuthnSvc dd ?
       dwAuthzSvc dd ?
       pAuthInfo dq ?
ends

struct SOLEAUTHENTICATIONLIST
       cAuthInfo dd ?,?
       aAuthInfo dq ?
ends

;IID_IClientSecurity GUID $0000013D,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IClientSecurity,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  QueryBlanket,\
	  SetBlanket,\
	  CopyProxy

;IID_IServerSecurity GUID $0000013E,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IServerSecurity,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  QueryBlanket,\
	  ImpersonateClient,\
	  RevertToSelf,\
	  IsImpersonating

;IID_IClassActivator GUID $00000140,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IClassActivator,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetClassObject

;IID_IRpcOptions GUID $00000144,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IRpcOptions,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Set,\
	  Query

COMBND_RPCTIMEOUT = 1
COMBND_SERVER_LOCALITY = 2

SERVER_LOCALITY_PROCESS_LOCAL = 0
SERVER_LOCALITY_MACHINE_LOCAL = 1
SERVER_LOCALITY_REMOTE = 2

;IID_IFillLockBytes GUID $99caf010,$415e,$11cf,<$88,$14,$00,$aa,$00,$b5,$69,$f5>
interface IFillLockBytes,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  FillAppend,\
	  FillAt,\
	  SetFillSize,\
	  Terminate

;IID_IProgressNotify GUID $a9d758a0,$4617,$11cf,<$95,$fc,$00,$aa,$00,$68,$0d,$b4>
interface IProgressNotify,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  OnProgress

struct STORAGELAYOUT
       LayoutType dd ?,?
       pwcsElementName dq ?
       cOffset dq ?
       cBytes dq ?
ends

;IID_ILayoutStorage GUID $0e6d4d90,$6738,$11cf,<$96,$08,$00,$aa,$00,$68,$0d,$b4>
interface ILayoutStorage,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  LayoutScript,\
	  BeginMonitor,\
	  EndMonitor,\
	  ReLayoutDocfile,\
	  ReLayoutDocfileOnILockBytes

;IID_IBlockingLock GUID $30f3d47a,$6447,$11d1,<$8e,$3c,$00,$c0,$4f,$b9,$38,$6d>
interface IBlockingLock,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Lock,\
	  Unlock

;IID_ITimeAndNoticeControl GUID $bc0bf6ae,$8878,$11d1,<$83,$e9,$00,$c0,$4f,$c2,$c6,$d4>
interface ITimeAndNoticeControl,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SuppressChanges

;IID_IOplockStorage GUID $8d19c834,$8879,$11d1,<$83,$e9,$00,$c0,$4f,$c2,$c6,$d4>
interface IOplockStorage,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  CreateStorageEx,\
	  OpenStorageEx

;IID_ISurrogate GUID $00000022,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface ISurrogate,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  LoadDllServer,\
	  FreeSurrogate

;IID_IGlobalInterfaceTable GUID $00000146,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IGlobalInterfaceTable,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  RegisterInterfaceInGlobal,\
	  RevokeInterfaceFromGlobal,\
	  GetInterfaceFromGlobal

;IID_IDirectWriterLock GUID $0e6d4d92,$6738,$11cf,<$96,$08,$00,$aa,$00,$68,$0d,$b4>
interface IDirectWriterLock,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  WaitForWriteAccess,\
	  ReleaseWriteAccess,\
	  HaveWriteAccess

;IID_ISynchronize GUID $00000030,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface ISynchronize,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Wait,\
	  Signal,\
	  Reset

;IID_ISynchronizeHandle GUID $00000031,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface ISynchronizeHandle,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetHandle

;IID_ISynchronizeEvent GUID $00000032,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface ISynchronizeEvent,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetHandle,\
	  SetEventHandle

;IID_ISynchronizeContainer GUID $00000033,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface ISynchronizeContainer,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  AddSynchronize,\
	  WaitMultiple

;IID_ISynchronizeMutex GUID $00000025,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface ISynchronizeMutex,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Wait,\
	  Signal,\
	  Reset,\
	  ReleaseMutex

;IID_ICancelMethodCalls GUID $00000029,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface ICancelMethodCalls,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Cancel,\
	  TestCancel

DCOM_NONE = 0
DCOM_CALL_COMPLETE = 1
DCOM_CALL_CANCELED = 2

;IID_IAsyncManager GUID $0000002A,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IAsyncManager,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  CompleteCall,\
	  GetCallContext,\
	  GetState

;IID_ICallFactory GUID $1c733a30,$2a1c,$11ce,<$ad,$e5,$00,$aa,$00,$44,$77,$3d>
interface ICallFactory,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  CreateCall

;IID_IRpcHelper GUID $00000149,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IRpcHelper,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetDCOMProtocolVersion,\
	  GetIIDFromOBJREF

;IID_IReleaseMarshalBuffers GUID $eb0cb9e8,$7996,$11d2,<$87,$2e,$00,$00,$f8,$08,$08,$59>
interface IReleaseMarshalBuffers,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  ReleaseMarshalBuffer

;IID_IWaitMultiple GUID $0000002B,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IWaitMultiple,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  WaitMultiple,\
	  AddSynchronize

;IID_IUrlMon GUID $00000026,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IUrlMon,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  AsyncGetClassBits

;IID_IForegroundTransfer GUID $00000145,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IForegroundTransfer,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  AllowForegroundTransfer

;IID_IAddrTrackingControl GUID $00000147,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IAddrTrackingControl,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  EnableCOMDynamicAddrTracking,\
	  DisableCOMDynamicAddrTracking

;IID_IAddrExclusionControl GUID $00000148,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IAddrExclusionControl,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetCurrentAddrExclusionList,\
	  UpdateAddrExclusionList

;IID_IPipeByte GUID $DB2F3ACA,$2F86,$11d1,<$8E,$04,$00,$C0,$4F,$B9,$98,$9A>
interface IPipeByte,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Pull,\
	  Push

;IID_AsyncIPipeByte GUID $DB2F3ACB,$2F86,$11d1,<$8E,$04,$00,$C0,$4F,$B9,$98,$9A>
interface AsyncIPipeByte,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Begin_Pull,\
	  Finish_Pull,\
	  Begin_Push,\
	  Finish_Push

;IID_IPipeLong GUID $DB2F3ACC,$2F86,$11d1,$8E,$04,$00,$C0,$4F,$B9,$98,$9A>
interface IPipeLong,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Pull,\
	  Push

;IID_AsyncIPipeLong GUID $DB2F3ACD,$2F86,$11d1,<$8E,$04,$00,$C0,$4F,$B9,$98,$9A>
interface AsyncIPipeLong,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Begin_Pull,\
	  Finish_Pull,\
	  Begin_Push,\
	  Finish_Push

;IID_IPipeDouble GUID $DB2F3ACE,$2F86,$11d1,<$8E,$04,$00,$C0,$4F,$B9,$98,$9A>
interface IPipeDouble,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Pull,\
	  Push

;IID_AsyncIPipeDouble GUID $DB2F3ACF,$2F86,$11d1,<$8E,$04,$00,$C0,$4F,$B9,$98,$9A>
interface AsyncIPipeDouble,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Begin_Pull,\
	  Finish_Pull,\
	  Begin_Push,\
	  Finish_Push

;IID_IThumbnailExtractor GUID $969dc708,$5c76,$11d1,<$8d,$86,$00,$00,$f8,$04,$b0,$57>
interface IThumbnailExtractor,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  ExtractThumbnail,\
	  OnFileUpdated

;IID_IDummyHICONIncluder GUID $947990de,$cc28,$11d2,<$a0,$f7,$00,$80,$5f,$85,$8f,$b1>
interface IDummyHICONIncluder,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Dummy

struct CONTEXTPROPERTY
       policyId GUID
       flags dd ?,?
       pUnk dq ?
ends

;IID_IEnumContextProps GUID $000001c1,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IEnumContextProps,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Next,\
	  Skip,\
	  Reset,\
	  Clone,\
	  Count

;IID_IContext GUID $000001c0,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IContext,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetProperty,\
	  RemoveProperty,\
	  GetProperty,\
	  EnumContextProps

;IID_IObjContext GUID $000001c6,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IObjContext,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetProperty,\
	  RemoveProperty,\
	  GetProperty,\
	  EnumContextProps,\
	  Reserved1,\
	  Reserved2,\
	  Reserved3,\
	  Reserved4,\
	  Reserved5,\
	  Reserved6,\
	  Reserved7

ServerApplication = 0
LibraryApplication = ServerApplication + 1

IdleShutdown = 0
ForcedShutdown = IdleShutdown + 1

;IID_IProcessLock GUID $000001d5,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IProcessLock,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  AddRefOnProcess,\
	  ReleaseRefOnProcess

;IID_ISurrogateService GUID $000001d4,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface ISurrogateService,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Init,\
	  ApplicationLaunch,\
	  ApplicationFree,\
	  CatalogRefresh,\
	  ProcessShutdown

APTTYPE_CURRENT = -1
APTTYPE_STA = 0
APTTYPE_MTA = 1
APTTYPE_NA = 2
APTTYPE_MAINSTA = 3

THDTYPE_BLOCKMESSAGES = 0
THDTYPE_PROCESSMESSAGES = 1

;IID_IComThreadingInfo GUID $000001ce,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IComThreadingInfo,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetCurrentApartmentType,\
	  GetCurrentThreadType,\
	  GetCurrentLogicalThreadId,\
	  SetCurrentLogicalThreadId

;IID_IProcessInitControl GUID $72380d55,$8d2b,$43a3,<$85,$13,$2b,$6e,$f3,$14,$34,$e9>
interface IProcessInitControl,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  ResetInitializerTimeout

;IID_IInitializeSpy GUID $00000034,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IInitializeSpy,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  PreInitialize,\
	  PostInitialize,\
	  PreUninitialize,\
	  PostUninitialize

;IID_IOleAdviseHolder GUID $00000111,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IOleAdviseHolder,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Advise,\
	  Unadvise,\
	  EnumAdvise,\
	  SendOnRename,\
	  SendOnSave,\
	  SendOnClose

;IID_IOleCache GUID $0000011e,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IOleCache,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Cache,\
	  Uncache,\
	  EnumCache,\
	  InitCache,\
	  SetData

UPDFCACHE_NODATACACHE = 1
UPDFCACHE_ONSAVECACHE = 2
UPDFCACHE_ONSTOPCACHE = 4
UPDFCACHE_NORMALCACHE = 8
UPDFCACHE_IFBLANK = $10
UPDFCACHE_ONLYIFBLANK = $80000000
UPDFCACHE_IFBLANKORONSAVECACHE = (UPDFCACHE_IFBLANK or UPDFCACHE_ONSAVECACHE)
UPDFCACHE_ALL = not UPDFCACHE_ONLYIFBLANK
UPDFCACHE_ALLBUTNODATACACHE = not UPDFCACHE_NODATACACHE

DISCARDCACHE_SAVEIFDIRTY = 0
DISCARDCACHE_NOSAVE = 1

;IID_IOleCache2 GUID $00000128,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IOleCache2,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Cache,\
	  Uncache,\
	  EnumCache,\
	  InitCache,\
	  SetData,\
	  UpdateCache,\
	  DiscardCache

;IID_IOleCacheControl GUID $00000129,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IOleCacheControl,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  OnRun,\
	  OnStop

;IID_IParseDisplayName GUID $0000011a,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IParseDisplayName,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  ParseDisplayName

;IID_IOleContainer GUID $0000011b,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IOleContainer,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  ParseDisplayName,\
	  EnumObjects,\
	  LockContainer

;IID_IOleClientSite GUID $00000118,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IOleClientSite,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SaveObject,\
	  GetMoniker,\
	  GetContainer,\
	  ShowObject,\
	  OnShowWindow,\
	  RequestNewObjectLayout

OLEGETMONIKER_ONLYIFTHERE = 1
OLEGETMONIKER_FORCEASSIGN = 2
OLEGETMONIKER_UNASSIGN = 3
OLEGETMONIKER_TEMPFORUSER = 4

OLEWHICHMK_CONTAINER = 1
OLEWHICHMK_OBJREL = 2
OLEWHICHMK_OBJFULL = 3

USERCLASSTYPE_FULL = 1
USERCLASSTYPE_SHORT = 2
USERCLASSTYPE_APPNAME = 3

OLEMISC_RECOMPOSEONRESIZE = 1
OLEMISC_ONLYICONIC = 2
OLEMISC_INSERTNOTREPLACE = 4
OLEMISC_STATIC = 8
OLEMISC_CANTLINKINSIDE = $10
OLEMISC_CANLINKBYOLE1 = $20
OLEMISC_ISLINKOBJECT = $40
OLEMISC_INSIDEOUT = $80
OLEMISC_ACTIVATEWHENVISIBLE = $100
OLEMISC_RENDERINGISDEVICEINDEPENDENT = $200
OLEMISC_INVISIBLEATRUNTIME = $400
OLEMISC_ALWAYSRUN = $800
OLEMISC_ACTSLIKEBUTTON = $1000
OLEMISC_ACTSLIKELABEL = $2000
OLEMISC_NOUIACTIVATE = $4000
OLEMISC_ALIGNABLE = $8000
OLEMISC_SIMPLEFRAME = $10000
OLEMISC_SETCLIENTSITEFIRST = $20000
OLEMISC_IMEMODE = $40000
OLEMISC_IGNOREACTIVATEWHENVISIBLE = $80000
OLEMISC_WANTSTOMENUMERGE = $100000
OLEMISC_SUPPORTSMULTILEVELUNDO = $200000

OLECLOSE_SAVEIFDIRTY = 0
OLECLOSE_NOSAVE = 1
OLECLOSE_PROMPTSAVE = 2

;IID_IOleObject GUID $00000112,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IOleObject,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetClientSite,\
	  GetClientSite,\
	  SetHostNames,\
	  Close,\
	  SetMoniker,\
	  GetMoniker,\
	  InitFromData,\
	  GetClipboardData,\
	  DoVerb,\
	  EnumVerbs,\
	  Update,\
	  IsUpToDate,\
	  GetUserClassID,\
	  GetUserType,\
	  SetExtent,\
	  GetExtent,\
	  Advise,\
	  Unadvise,\
	  EnumAdvise,\
	  GetMiscStatus,\
	  SetColorScheme

OLERENDER_NONE = 0
OLERENDER_DRAW = 1
OLERENDER_FORMAT = 2
OLERENDER_ASIS = 3

struct OBJECTDESCRIPTOR
       cbSize dd ?
       clsid GUID
       dwDrawAspect dd ?
       sizel SIZEL
       pointl POINTL
       dwStatus dd ?
       dwFullUserTypeName dd ?
       dwSrcOfCopy dd ?
ends

;IID_IOleWindow GUID $00000114,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IOleWindow,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetWindow,\
	  ContextSensitiveHelp

OLEUPDATE_ALWAYS = 1
OLEUPDATE_ONCALL = 3
OLELINKBIND_EVENIFCLASSDIFF = 1

;IID_IOleLink GUID $0000011d,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IOleLink,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetUpdateOptions,\
	  GetUpdateOptions,\
	  SetSourceMoniker,\
	  GetSourceMoniker,\
	  SetSourceDisplayName,\
	  GetSourceDisplayName,\
	  BindToSource,\
	  BindIfRunning,\
	  GetBoundSource,\
	  UnbindSource,\
	  Update

BINDSPEED_INDEFINITE = 1
BINDSPEED_MODERATE = 2
BINDSPEED_IMMEDIATE = 3

OLECONTF_EMBEDDINGS = 1
OLECONTF_LINKS = 2
OLECONTF_OTHERS = 4
OLECONTF_ONLYUSER = 8
OLECONTF_ONLYIFRUNNING = 16

;IID_IOleItemContainer GUID $0000011c,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IOleItemContainer,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  ParseDisplayName,\
	  EnumObjects,\
	  LockContainer,\
	  GetObject,\
	  GetObjectStorage,\
	  IsRunning

;IID_IOleInPlaceUIWindow GUID $00000115,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IOleInPlaceUIWindow,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetWindow,\
	  ContextSensitiveHelp,\
	  GetBorder,\
	  RequestBorderSpace,\
	  SetBorderSpace,\
	  SetActiveObject

;IID_IOleInPlaceActiveObject GUID $00000117,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IOleInPlaceActiveObject,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetWindow,\
	  ContextSensitiveHelp,\
	  TranslateAccelerator,\
	  OnFrameWindowActivate,\
	  OnDocWindowActivate,\
	  ResizeBorder,\
	  EnableModeless

struct OLEINPLACEFRAMEINFO
       cb dd ?
       fMDIApp dd ?
       hwndFrame dq ?
       haccel dq ?
       cAccelEntries dd ?,?
ends

struct OLEMENUGROUPWIDTHS
       width dd 6 dup(?)
ends

;IID_IOleInPlaceFrame GUID $00000116,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IOleInPlaceFrame,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  ContextSensitiveHelp,\
	  GetBorder,\
	  RequestBorderSpace,\
	  SetBorderSpace,\
	  SetActiveObject,\
	  InsertMenus,\
	  SetMenu,\
	  RemoveMenus,\
	  SetStatusText,\
	  EnableModeless,\
	  TranslateAccelerator

;IID_IOleInPlaceObject GUID $00000113,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IOleInPlaceObject,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetWindow,\
	  ContextSensitiveHelp,\
	  InPlaceDeactivate,\
	  UIDeactivate,\
	  SetObjectRects,\
	  ReactivateAndUndo

;IID_IOleInPlaceSite GUID $00000119,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IOleInPlaceSite,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetWindow,\
	  ContextSensitiveHelp,\
	  CanInPlaceActivate,\
	  OnInPlaceActivate,\
	  OnUIActivate,\
	  GetWindowContext,\
	  Scroll,\
	  OnUIDeactivate,\
	  OnInPlaceDeactivate,\
	  DiscardUndoState,\
	  DeactivateAndUndo,\
	  OnPosRectChange

;IID_IContinue GUID $0000012a,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IContinue,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  FContinue

;IID_IViewObject GUID $0000010d,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IViewObject,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Draw,\
	  GetColorSet,\
	  Freeze,\
	  Unfreeze,\
	  SetAdvise,\
	  GetAdvise

;IID_IViewObject2 GUID $00000127,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IViewObject2,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Draw,\
	  GetColorSet,\
	  Freeze,\
	  Unfreeze,\
	  SetAdvise,\
	  GetAdvise,\
	  GetExtent

;IID_IDropSource GUID $00000121,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IDropSource,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  QueryContinueDrag,\
	  GiveFeedback

MK_ALT = $20
DROPEFFECT_NONE = 0
DROPEFFECT_COPY = 1
DROPEFFECT_MOVE = 2
DROPEFFECT_LINK = 4
DROPEFFECT_SCROLL = $80000000

DD_DEFSCROLLINSET = 11
DD_DEFSCROLLDELAY = 50
DD_DEFSCROLLINTERVAL = 50
DD_DEFDRAGDELAY = 200
DD_DEFDRAGMINDIST = 2

;IID_IDropTarget GUID $00000122,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IDropTarget,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  DragEnter,\
	  DragOver,\
	  DragLeave,\
	  Drop

struct OLEVERB
       lVerb dd ?,?
       lpszVerbName dq ?
       fuFlags dd ?
       grfAttribs dd ?
ends

OLEVERBATTRIB_NEVERDIRTIES = 1
OLEVERBATTRIB_ONCONTAINERMENU = 2

;IID_IEnumOLEVERB GUID $00000104,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IEnumOLEVERB,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Next,\
	  Skip,\
	  Reset,\
	  Clone

COINIT_APARTMENTTHREADED = 2
COINIT_MULTITHREADED = 0
COINIT_DISABLE_OLE1DDE = 4
COINIT_SPEED_OVER_MEMORY = 8

SD_LAUNCHPERMISSIONS = 0
SD_ACCESSPERMISSIONS = 1
SD_LAUNCHRESTRICTIONS = 2
SD_ACCESSRESTRICTIONS = 3

struct SOLETLSDATAPUBLIC
       pvReserved0 dq ?,?
       dwReserved0 dd ?,?,?,?
       pvReserved1 dq ?
       dwReserved1 dd ?,?,?,?
       pvReserved2 dq 4 dup(?)
       dwReserved2 dd ?,?
       pCurrentCtx dq ?
ends

SMEXF_SERVER = 1
SMEXF_HANDLER = 2

COM_RIGHTS_EXECUTE = 1
COM_RIGHTS_EXECUTE_LOCAL = 2
COM_RIGHTS_EXECUTE_REMOTE = 4
COM_RIGHTS_ACTIVATE_LOCAL = 8
COM_RIGHTS_ACTIVATE_REMOTE = 16

COWAIT_WAITALL = 1
COWAIT_ALERTABLE = 2
COWAIT_INPUTAVAILABLE = 4

STGOPTIONS_VERSION = 2

struct STGOPTIONS
       usVersion dw ?
       reserved dw ?
       ulSectorSize dd ?
       pwcsTemplateFile dq ?
ends

struct SAFEARRAYBOUND
       cElements dd ?
       lLbound dd ?
ends

struct SAFEARRBSTR
       Size dd ?,?
       aBstr dq ?
ends

struct SAFEARRUNKNOWN
       Size dd ?,?
       apUnknown dq ?
ends

struct SAFEARRDISPATCH
       Size dd ?,?
       apDispatch dq ?
ends

struct SAFEARRVARIANT
       Size dd ?,?
       aVariant dq ?
ends

struct SAFEARRBRECORD
       Size dd ?,?
       aRecord dq ?
ends

struct SAFEARRHAVEIID
       Size dd ?,?
       apUnknown dq ?
       iid GUID
ends

SF_ERROR = VT_ERROR
SF_I1 = VT_I1
SF_I2 = VT_I2
SF_I4 = VT_I4
SF_I8 = VT_I8
SF_BSTR = VT_BSTR
SF_UNKNOWN = VT_UNKNOWN
SF_DISPATCH = VT_DISPATCH
SF_VARIANT = VT_VARIANT
SF_RECORD = VT_RECORD
SF_HAVEIID = VT_UNKNOWN or VT_RESERVED

struct SAFEARRAYUNION
       sfType dd ?,?
       union
	   BstrStr SAFEARRBSTR
	   UnknownStr SAFEARRUNKNOWN
	   DispatchStr SAFEARRDISPATCH
	   VariantStr SAFEARRVARIANT
	   RecordStr SAFEARRBRECORD
	   HaveIidStr SAFEARRHAVEIID
	   ByteStr BYTESIZEDARR
	   WordStr WORDSIZEDARR
	   LongStr DWORDSIZEDARR
	   HyperStr HYPERSIZEDARR
       ends
ends

struct WIRESAFEARRAY
       cDims dw ?
       fFeatures dw ?
       cbElements dd ?
       cLocks dd ?,?
       uArrayStructs SAFEARRAYUNION
       rgsabound SAFEARRAYBOUND
ends

struct SAFEARRAY
       cDims dw ?
       fFeatures dw ?
       cbElements dd ?
       cLocks dd ?,?
       pvData dq ?
       rgsabound SAFEARRAYBOUND
ends

FADF_AUTO = 1
FADF_STATIC = 2
FADF_EMBEDDED = 4
FADF_FIXEDSIZE = $10
FADF_RECORD = $20
FADF_HAVEIID = $40
FADF_HAVEVARTYPE = $80
FADF_BSTR = $100
FADF_UNKNOWN = $200
FADF_DISPATCH = $400
FADF_VARIANT = $800
FADF_RESERVED = $f008

struct VARIANT
   union
       struct
           vt dw ?
           wReserved1 dw ?
           wReserved2 dw ?
           wReserved3 dw ?
           union
               llVal dq ?
               lVal dd ?
               bVal db ?
               iVal dw ?
               fltVal dd ?
               dblVal dq ?
               boolVal dw ?
               bool dw ?
               scode dd ?
               cyVal CY
               date dq ?
               bstrVal dq ?
               punkVal dq ?
               pdispVal dq ?
               parray dq ?
               pbVal dq ?
               piVal dq ?
               plVal dq ?
               pllVal dq ?
               pfltVal dq ?
               pdblVal dq ?
               pboolVal dq ?
               pbool dq ?
               pscode dq ?
               pcyVal dq ?
               pdate dq ?
               pbstrVal dq ?
               ppunkVal dq ?
               ppdispVal dq ?
               pparray dq ?
               pvarVal dq ?
               byref dq ?
               cVal db ?
               uiVal dw ?
               ulVal dd ?
               ullVal dq ?
               intVal dd ?
               uintVal dd ?
               pdecVal dq ?
               pcVal dq ?
               puiVal dq ?
               pulVal dq ?
               pullVal dq ?
               pintVal dq ?
               puintVal dq ?
               struct
                   pvRecord dq ?
                   pRecInfo dq ?
               ends
           ends
       ends
       decVal DECIMAL
   ends
ends

struct BRECORD
       fFlags dd ?
       clSize dd ?
       pRecInfo dq ?
       pRecord dq ?
ends

struct WIREVARIANT
   clSize dd ?
   rpcReserved dd ?
   vt dw ?
   wReserved1 dw ?
   wReserved2 dw ?
   wReserved3 dw ?
   union
       llVal dq ?
       lVal dd ?
       bVal db ?
       iVal dw ?
       fltVal dd ?
       dblVal dq ?
       boolVal dw ?
       scode dd ?
       cyVal CY
       date dq ?
       bstrVal dq ?
       punkVal dq ?
       pdispVal dq ?
       parray dq ?
       brecVal dq ?
       pbVal dq ?
       piVal dq ?
       plVal dq ?
       pllVal dq ?
       pfltVal dq ?
       pdblVal dq ?
       pboolVal dq ?
       pscode dq ?
       pcyVal dq ?
       pdate dq ?
       pbstrVal dq ?
       ppunkVal dq ?
       ppdispVal dq ?
       pparray dq ?
       pvarVal dq ?
       cVal db ?
       uiVal dw ?
       ulVal dd ?
       ullVal dq ?
       intVal dd ?
       uintVal dd ?
       decVal DECIMAL
       pdecVal dq ?
       pcVal dq ?
       puiVal dq ?
       pulVal dq ?
       pullVal dq ?
       pintVal dq ?
       puintVal dq ?
   ends
ends

TKIND_ENUM = 0
TKIND_RECORD = TKIND_ENUM + 1
TKIND_MODULE = TKIND_RECORD + 1
TKIND_INTERFACE = TKIND_MODULE + 1
TKIND_DISPATCH = TKIND_INTERFACE + 1
TKIND_COCLASS = TKIND_DISPATCH + 1
TKIND_ALIAS = TKIND_COCLASS + 1
TKIND_UNION = TKIND_ALIAS + 1
TKIND_MAX = TKIND_UNION + 1

struct TYPEDESC
       union
	   lptdesc dq ?
	   lpadesc dq ?
	   hreftype dq ?
       ends
       vt dw ?,?,?,?
ends

struct ARRAYDESC
       tdescElem TYPEDESC
       cDims dw ?,?,?,?
       rgbounds SAFEARRAYBOUND
ends

struct PARAMDESCEX
       cBytes dd ?,?
       varDefaultValue VARIANT
ends

struct PARAMDESC
       pparamdescex dq ?
       wParamFlags dw ?,?,?,?
ends

PARAMFLAG_NONE = 0
PARAMFLAG_FIN = 1
PARAMFLAG_FOUT = 2
PARAMFLAG_FLCID = 4
PARAMFLAG_FRETVAL = 8
PARAMFLAG_FOPT = $10
PARAMFLAG_FHASDEFAULT = $20
PARAMFLAG_FHASCUSTDATA = $40

struct IDLDESC
       dwReserved dq ?
       wIDLFlags dw ?,?,?,?
ends

IDLFLAG_NONE = PARAMFLAG_NONE
IDLFLAG_FIN = PARAMFLAG_FIN
IDLFLAG_FOUT = PARAMFLAG_FOUT
IDLFLAG_FLCID = PARAMFLAG_FLCID
IDLFLAG_FRETVAL = PARAMFLAG_FRETVAL

struct ELEMDESC
       tdesc TYPEDESC
       union
	   idldesc IDLDESC
	   paramdesc PARAMDESC
       ends
ends

struct TYPEATTR
       guid GUID
       lcid dd ?
       dwReserved dd ?
       memidConstructor dd ?
       memidDestructor dd ?
       lpstrSchema dq ?
       cbSizeInstance dd ?
       typekind dd ?
       cFuncs dw ?
       cVars dw ?
       cImplTypes dw ?
       cbSizeVft dw ?
       cbAlignment dw ?
       wTypeFlags dw ?
       wMajorVerNum dw ?
       wMinorVerNum dw ?
       tdescAlias TYPEDESC
       idldescType IDLDESC
ends

struct DISPPARAMS
       rgvarg dq ?
       rgdispidNamedArgs dq ?
       cArgs dd ?
       cNamedArgs dd ?
ends

struct EXCEPINFO
       wCode dw ?
       wReserved dw ?,?,?
       bstrSource dq ?
       bstrDescription dq ?
       bstrHelpFile dq ?
       dwHelpContext dd ?,?
       pvReserved dq ?
       pfnDeferredFillIn dq ?
       scode dd ?,?
ends

CC_FASTCALL = 0
CC_CDECL = 1
CC_MSCPASCAL = CC_CDECL + 1
CC_PASCAL = CC_MSCPASCAL
CC_MACPASCAL = CC_PASCAL + 1
CC_STDCALL = CC_MACPASCAL + 1
CC_FPFASTCALL = CC_STDCALL + 1
CC_SYSCALL = CC_FPFASTCALL + 1
CC_MPWCDECL = CC_SYSCALL + 1
CC_MPWPASCAL = CC_MPWCDECL + 1
CC_MAX = CC_MPWPASCAL + 1

FUNC_VIRTUAL = 0
FUNC_PUREVIRTUAL = FUNC_VIRTUAL + 1
FUNC_NONVIRTUAL = FUNC_PUREVIRTUAL + 1
FUNC_STATIC = FUNC_NONVIRTUAL + 1
FUNC_DISPATCH = FUNC_STATIC + 1

INVOKE_FUNC = 1
INVOKE_PROPERTYGET = 2
INVOKE_PROPERTYPUT = 4
INVOKE_PROPERTYPUTREF = 8

struct FUNCDESC
       memid dd ?,?
       lprgscode dq ?
       lprgelemdescParam dq ?
       funckind dd ?
       invkind dd ?
       callconv dd ?
       cParams dw ?
       cParamsOpt dw ?
       oVft dw ?
       cScodes dw ?,?,?
       elemdescFunc ELEMDESC
       wFuncFlags dw ?,?,?,?
ends

VAR_PERINSTANCE = 0
VAR_STATIC = VAR_PERINSTANCE + 1
VAR_CONST = VAR_STATIC + 1
VAR_DISPATCH = VAR_CONST + 1

IMPLTYPEFLAG_FDEFAULT = 1
IMPLTYPEFLAG_FSOURCE = 2
IMPLTYPEFLAG_FRESTRICTED = 4
IMPLTYPEFLAG_FDEFAULTVTABLE = 8

struct VARDESC
       memid dd ?,?
       lpstrSchema dq ?
       union
	   oInst dd ?
	   lpvarValue dq ?
       ends
       elemdescVar ELEMDESC
       wVarFlags dw ?
       varkind dd ?
       dw ?
ends

TYPEFLAG_FAPPOBJECT = 1
TYPEFLAG_FCANCREATE = 2
TYPEFLAG_FLICENSED = 4
TYPEFLAG_FPREDECLID = 8
TYPEFLAG_FHIDDEN = $10
TYPEFLAG_FCONTROL = $20
TYPEFLAG_FDUAL = $40
TYPEFLAG_FNONEXTENSIBLE = $80
TYPEFLAG_FOLEAUTOMATION = $100
TYPEFLAG_FRESTRICTED = $200
TYPEFLAG_FAGGREGATABLE = $400
TYPEFLAG_FREPLACEABLE = $800
TYPEFLAG_FDISPATCHABLE = $1000
TYPEFLAG_FREVERSEBIND = $2000
TYPEFLAG_FPROXY = $4000

FUNCFLAG_FRESTRICTED = 1
FUNCFLAG_FSOURCE = 2
FUNCFLAG_FBINDABLE = 4
FUNCFLAG_FREQUESTEDIT = 8
FUNCFLAG_FDISPLAYBIND = $10
FUNCFLAG_FDEFAULTBIND = $20
FUNCFLAG_FHIDDEN = $40
FUNCFLAG_FUSESGETLASTERROR = $80
FUNCFLAG_FDEFAULTCOLLELEM = $100
FUNCFLAG_FUIDEFAULT = $200
FUNCFLAG_FNONBROWSABLE = $400
FUNCFLAG_FREPLACEABLE = $800
FUNCFLAG_FIMMEDIATEBIND = $1000

VARFLAG_FREADONLY = 1
VARFLAG_FSOURCE = 2
VARFLAG_FBINDABLE = 4
VARFLAG_FREQUESTEDIT = 8
VARFLAG_FDISPLAYBIND = $10
VARFLAG_FDEFAULTBIND = $20
VARFLAG_FHIDDEN = $40
VARFLAG_FRESTRICTED = $80
VARFLAG_FDEFAULTCOLLELEM = $100
VARFLAG_FUIDEFAULT = $200
VARFLAG_FNONBROWSABLE = $400
VARFLAG_FREPLACEABLE = $800
VARFLAG_FIMMEDIATEBIND = $1000

struct CLEANLOCALSTORAGE
       pInterface dq ?
       pStorage dq ?
       flags dd ?,?
ends

struct CUSTDATAITEM
       guid GUID
       varValue VARIANT
ends

struct CUSTDATA
       cCustData dd ?,?
       prgCustData dq ?
ends

;IID_ICreateTypeInfo GUID $00020405,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface ICreateTypeInfo,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetGuid,\
	  SetTypeFlags,\
	  SetDocString,\
	  SetHelpContext,\
	  SetVersion,\
	  AddRefTypeInfo,\
	  AddFuncDesc,\
	  AddImplType,\
	  SetImplTypeFlags,\
	  SetAlignment,\
	  SetSchema,\
	  AddVarDesc,\
	  SetFuncAndParamNames,\
	  SetVarName,\
	  SetTypeDescAlias,\
	  DefineFuncAsDllEntry,\
	  SetFuncDocString,\
	  SetVarDocString,\
	  SetFuncHelpContext,\
	  SetVarHelpContext,\
	  SetMops,\
	  SetTypeIdldesc,\
	  LayOut

;IID_ICreateTypeInfo2 GUID $0002040E,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface ICreateTypeInfo2,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetGuid,\
	  SetTypeFlags,\
	  SetDocString,\
	  SetHelpContext,\
	  SetVersion,\
	  AddRefTypeInfo,\
	  AddFuncDesc,\
	  AddImplType,\
	  SetImplTypeFlags,\
	  SetAlignment,\
	  SetSchema,\
	  AddVarDesc,\
	  SetFuncAndParamNames,\
	  SetVarName,\
	  SetTypeDescAlias,\
	  DefineFuncAsDllEntry,\
	  SetFuncDocString,\
	  SetVarDocString,\
	  SetFuncHelpContext,\
	  SetVarHelpContext,\
	  SetMops,\
	  SetTypeIdldesc,\
	  LayOut,\
	  DeleteFuncDesc,\
	  DeleteFuncDescByMemId,\
	  DeleteVarDesc,\
	  DeleteVarDescByMemId,\
	  DeleteImplType,\
	  SetCustData,\
	  SetFuncCustData,\
	  SetParamCustData,\
	  SetVarCustData,\
	  SetImplTypeCustData,\
	  SetHelpStringContext,\
	  SetFuncHelpStringContext,\
	  SetVarHelpStringContext,\
	  Invalidate,\
	  SetName

;IID_ICreateTypeLib GUID $00020406,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface ICreateTypeLib,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  CreateTypeInfo,\
	  SetName,\
	  SetVersion,\
	  SetGuid,\
	  SetDocString,\
	  SetHelpFileName,\
	  SetHelpContext,\
	  SetLcid,\
	  SetLibFlags,\
	  SaveAllChanges

;IID_ICreateTypeLib2 GUID $0002040F,$0000,$000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface ICreateTypeLib2,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  CreateTypeInfo,\
	  SetName,\
	  SetVersion,\
	  SetGuid,\
	  SetDocString,\
	  SetHelpFileName,\
	  SetHelpContext,\
	  SetLcid,\
	  SetLibFlags,\
	  SaveAllChanges,\
	  DeleteTypeInfo,\
	  SetCustData,\
	  SetHelpStringContext,\
	  SetHelpStringDll

DISPID_UNKNOWN = -1
DISPID_VALUE = 0
DISPID_PROPERTYPUT = -3
DISPID_NEWENUM = -4
DISPID_EVALUATE = -5
DISPID_CONSTRUCTOR = -6
DISPID_DESTRUCTOR = -7
DISPID_COLLECT = -8

;IID_IDispatch GUID $00020400,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IDispatch,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetTypeInfoCount,\
	  GetTypeInfo,\
	  GetIDsOfNames,\
	  Invoke

;IID_IEnumVARIANT GUID $00020404,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IEnumVARIANT,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Next,\
	  Skip,\
	  Reset,\
	  Clone

DESCKIND_NONE = 0
DESCKIND_FUNCDESC = DESCKIND_NONE + 1
DESCKIND_VARDESC = DESCKIND_FUNCDESC + 1
DESCKIND_TYPECOMP = DESCKIND_VARDESC + 1
DESCKIND_IMPLICITAPPOBJ = DESCKIND_TYPECOMP + 1
DESCKIND_MAX = DESCKIND_IMPLICITAPPOBJ + 1

struct BINDPTR
       union
	   lpfuncdesc dq ?
	   lpvardesc dq ?
	   lptcomp dq ?
       ends
ends

;IID_ITypeComp GUID $00020403,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface ITypeComp,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Bind,\
	  BindType

;IID_ITypeInfo GUID $00020401,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface ITypeInfo,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetTypeAttr,\
	  GetTypeComp,\
	  GetFuncDesc,\
	  GetVarDesc,\
	  GetNames,\
	  GetRefTypeOfImplType,\
	  GetImplTypeFlags,\
	  GetIDsOfNames,\
	  Invoke,\
	  GetDocumentation,\
	  GetDllEntry,\
	  GetRefTypeInfo,\
	  AddressOfMember,\
	  CreateInstance,\
	  GetMops,\
	  GetContainingTypeLib,\
	  ReleaseTypeAttr,\
	  ReleaseFuncDesc,\
	  ReleaseVarDesc

;IID_ITypeInfo2 GUID $00020412,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface ITypeInfo2,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetTypeAttr,\
	  GetTypeComp,\
	  GetFuncDesc,\
	  GetVarDesc,\
	  GetNames,\
	  GetRefTypeOfImplType,\
	  GetImplTypeFlags,\
	  GetIDsOfNames,\
	  Invoke,\
	  GetDocumentation,\
	  GetDllEntry,\
	  GetRefTypeInfo,\
	  AddressOfMember,\
	  CreateInstance,\
	  GetMops,\
	  GetContainingTypeLib,\
	  ReleaseTypeAttr,\
	  ReleaseFuncDesc,\
	  ReleaseVarDesc,\
	  GetTypeKind,\
	  GetTypeFlags,\
	  GetFuncIndexOfMemId,\
	  GetVarIndexOfMemId,\
	  GetCustData,\
	  GetFuncCustData,\
	  GetParamCustData,\
	  GetVarCustData,\
	  GetImplTypeCustData,\
	  GetDocumentation2,\
	  GetAllCustData,\
	  GetAllFuncCustData,\
	  GetAllParamCustData,\
	  GetAllVarCustData,\
	  GetAllImplTypeCustData

SYS_WIN16 = 0
SYS_WIN32 = SYS_WIN16 + 1
SYS_MAC = SYS_WIN32 + 1
SYS_WIN64 = SYS_MAC + 1

LIBFLAG_FRESTRICTED = 1
LIBFLAG_FCONTROL = 2
LIBFLAG_FHIDDEN = 4
LIBFLAG_FHASDISKIMAGE = 8

struct TLIBATTR
       guid GUID
       lcid dd ?
       syskind dd ?
       wMajorVerNum dw ?
       wMinorVerNum dw ?
       wLibFlags dw ?,?
ends

;IID_ITypeLib GUID $00020402,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface ITypeLib,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetTypeInfoCount,\
	  GetTypeInfo,\
	  GetTypeInfoType,\
	  GetTypeInfoOfGuid,\
	  GetLibAttr,\
	  GetTypeComp,\
	  GetDocumentation,\
	  IsName,\
	  FindName,\
	  ReleaseTLibAttr

;IID_ITypeLib2 GUID $00020411,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface ITypeLib2,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetTypeInfoCount,\
	  GetTypeInfo,\
	  GetTypeInfoType,\
	  GetTypeInfoOfGuid,\
	  GetLibAttr,\
	  GetTypeComp,\
	  GetDocumentation,\
	  IsName,\
	  FindName,\
	  ReleaseTLibAttr,\
	  GetCustData,\
	  GetLibStatistics,\
	  GetDocumentation2,\
	  GetAllCustData

CHANGEKIND_ADDMEMBER = 0
CHANGEKIND_DELETEMEMBER = CHANGEKIND_ADDMEMBER + 1
CHANGEKIND_SETNAMES = CHANGEKIND_DELETEMEMBER + 1
CHANGEKIND_SETDOCUMENTATION = CHANGEKIND_SETNAMES + 1
CHANGEKIND_GENERAL = CHANGEKIND_SETDOCUMENTATION + 1
CHANGEKIND_INVALIDATE = CHANGEKIND_GENERAL + 1
CHANGEKIND_CHANGEFAILED = CHANGEKIND_INVALIDATE + 1
CHANGEKIND_MAX = CHANGEKIND_CHANGEFAILED + 1


;IID_ITypeChangeEvents GUID $00020410-0000-0000-C000-000000000046")
interface ITypeChangeEvents,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  RequestTypeChange,\
	  AfterTypeChange

;IID_IErrorInfo GUID $1CF2B120,$547D,$101B,<$8E,$65,8,0,$2B,$2B,$D1,$19>
interface IErrorInfo,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetGUID,\
	  GetSource,\
	  GetDescription,\
	  GetHelpFile,\
	  GetHelpContext

;IID_ICreateErrorInfo GUID $22F03340,$547D,$101B,<$8E,$65,8,0,$2B,$2B,$D1,$19>
interface ICreateErrorInfo,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetGUID,\
	  SetSource,\
	  SetDescription,\
	  SetHelpFile,\
	  SetHelpContext

;IID_ISupportErrorInfo GUID $DF0B3D60,$548F,$101B,<$8E,$65,8,0,$2B,$2B,$D1,$19>
interface ISupportErrorInfo,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  InterfaceSupportsErrorInfo

;IID_ITypeFactory GUID $0000002E,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface ITypeFactory,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  CreateFromTypeInfo

;IID_ITypeMarshal GUID $0000002D,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface ITypeMarshal,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Size,\
	  Marshal,\
	  Unmarshal,\
	  Free

;IID_IRecordInfo GUID $0000002F,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IRecordInfo,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  RecordInit,\
	  RecordClear,\
	  RecordCopy,\
	  GetGuid,\
	  GetName,\
	  GetSize,\
	  GetTypeInfo,\
	  GetField,\
	  GetFieldNoCopy,\
	  PutField,\
	  PutFieldNoCopy,\
	  GetFieldNames,\
	  IsMatchingType,\
	  RecordCreate,\
	  RecordCreateCopy,\
	  RecordDestroy

;IID_IErrorLog GUID $3127CA40,$446E,$11CE,<$81,$35,$00,$AA,$00,$4B,$B8,$51>
interface IErrorLog,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  AddError

;IID_IPropertyBag GUID $55272A00,$42CB,$11CE,<$81,$35,$00,$AA,$00,$4B,$B8,$51>
interface IPropertyBag,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Read,\
	  Write

struct VERSIONEDSTREAM
       guidVersion GUID
       pStream dq ?
ends

PROPSETFLAG_DEFAULT = 0
PROPSETFLAG_NONSIMPLE = 1
PROPSETFLAG_ANSI = 2
PROPSETFLAG_UNBUFFERED = 4
PROPSETFLAG_CASE_SENSITIVE = 8
PROPSET_BEHAVIOR_CASE_SENSITIVE = 1

struct CAC
       cElems dd ?,?
       pElems dq ?
ends

struct CAUB
       cElems dd ?,?
       pElems dq ?
ends

struct CAI
       cElems dd ?,?
       pElems dq ?
ends

struct CAUI
       cElems dd ?,?
       pElems dq ?
ends

struct CAL
       cElems dd ?,?
       pElems dq ?
ends

struct CAUL
       cElems dd ?,?
       pElems dq ?
ends

struct CAFLT
       cElems dd ?,?
       pElems dq ?
ends

struct CADBL
       cElems dd ?,?
       pElems dq ?
ends

struct CACY
       cElems dd ?,?
       pElems dq ?
ends

struct CADATE
       cElems dd ?,?
       pElems dq ?
ends

struct CABSTR
       cElems dd ?,?
       pElems dq ?
ends

struct CABSTRBLOB
       cElems dd ?,?
       pElems dq ?
ends

struct CABOOL
       cElems dd ?,?
       pElems dq ?
ends

struct CASCODE
       cElems dd ?,?
       pElems dq ?
ends

struct CAPROPVARIANT
       cElems dd ?,?
       pElems dq ?
ends

struct CAH
       cElems dd ?,?
       pElems dq ?
ends

struct CAUH
       cElems dd ?,?
       pElems dq ?
ends

struct CALPSTR
       cElems dd ?,?
       pElems dq ?
ends

struct CALPWSTR
       cElems dd ?,?
       pElems dq ?
ends

struct CAFILETIME
       cElems dd ?,?
       pElems dq ?
ends

struct CACLIPDATA
       cElems dd ?,?
       pElems dq ?
ends

struct CACLSID
       cElems dd ?,?
       pElems dq ?
ends

struct PROPVARIANT
   struct
       vt dw ?
       wReserved1 dw ?
       wReserved2 dw ?
       wReserved3 dw ?
       union
           cVal db ?
           bVal db ?
           iVal dw ?
           uiVal dw ?
           lVal dd ?
           ulVal dd ?
           intVal dd ?
           uintVal dd ?
           hVal dq ?
           uhVal dq ?
           fltVal dd ?
           dblVal dq ?
           boolVal dw ?
           scode dd ?
           cyVal CY
           date dq ?
           filetime FILETIME
           puuid dq ?
           pclipdata dq ?
           bstrVal dq ?
           bstrblobVal BSTRBLOB
           blob BLOB
           pszVal dq ?
           pwszVal dq ?
           punkVal dq ?
           pdispVal dq ?
           pStream dq ?
           pStorage dq ?
           pVersionedStream dq ?
           parray dq ?
           cac CAC
           caub CAUB
           cai CAI
           caui CAUI
           cal CAL
           caul CAUL
           cah CAH
           cauh CAUH
           caflt CAFLT
           cadbl CADBL
           cabool CABOOL
           cascode CASCODE
           cacy CACY
           cadate CADATE
           cafiletime CAFILETIME
           cauuid CACLSID
           caclipdata CACLIPDATA
           cabstr CABSTR
           cabstrblob CABSTRBLOB
           calpstr CALPSTR
           calpwstr CALPWSTR
           capropvar CAPROPVARIANT
           pcVal dq ?
           pbVal dq ?
           piVal dq ?
           puiVal dq ?
           plVal dq ?
           pulVal dq ?
           pintVal dq ?
           puintVal dq ?
           pfltVal dq ?
           pdblVal dq ?
           pboolVa dq ?
           pdecVal dq ?
           pscode dq ?
           pcyVal dq ?
           pdate dq ?
           pbstrVal dq ?
           ppunkVal dq ?
           ppdispVal dq ?
           pparray dq ?
           pvarVal dq ?
       ends
   ends
ends

PID_DICTIONARY = 0
PID_CODEPAGE = 1
PID_FIRST_USABLE = 2
PID_FIRST_NAME_DEFAULT	= $fff
PID_LOCALE = $80000000
PID_MODIFY_TIME = $80000001
PID_SECURITY = $80000002
PID_BEHAVIOR = $80000003
PID_ILLEGAL = $ffffffff
PID_MIN_READONLY = $80000000
PID_MAX_READONLY = $bfffffff

PIDDI_THUMBNAIL = 2

PIDSI_TITLE = 2
PIDSI_SUBJECT = 3
PIDSI_AUTHOR = 4
PIDSI_KEYWORDS = 5
PIDSI_COMMENTS = 6
PIDSI_TEMPLATE = 7
PIDSI_LASTAUTHOR = 8
PIDSI_REVNUMBER = 9
PIDSI_EDITTIME = $a
PIDSI_LASTPRINTED = $b
PIDSI_CREATE_DTM = $c
PIDSI_LASTSAVE_DTM = $d
PIDSI_PAGECOUNT = $e
PIDSI_WORDCOUNT = $f
PIDSI_CHARCOUNT = $10
PIDSI_THUMBNAIL = $11
PIDSI_APPNAME = $12
PIDSI_DOC_SECURITY = $13

PIDDSI_CATEGORY = 2
PIDDSI_PRESFORMAT = 3
PIDDSI_BYTECOUNT = 4
PIDDSI_LINECOUNT = 5
PIDDSI_PARCOUNT = 6
PIDDSI_SLIDECOUNT = 7
PIDDSI_NOTECOUNT = 8
PIDDSI_HIDDENCOUNT = 9
PIDDSI_MMCLIPCOUNT = $A
PIDDSI_SCALE = $B
PIDDSI_HEADINGPAIR = $C
PIDDSI_DOCPARTS = $D
PIDDSI_MANAGER = $E
PIDDSI_COMPANY = $F
PIDDSI_LINKSDIRTY = $10

PIDMSI_EDITOR = 2
PIDMSI_SUPPLIER = 3
PIDMSI_SOURCE = 4
PIDMSI_SEQUENCE_NO = 5
PIDMSI_PROJECT = 6
PIDMSI_STATUS = 7
PIDMSI_OWNER = 8
PIDMSI_RATING = 9
PIDMSI_PRODUCTION = $A
PIDMSI_COPYRIGHT = $B

PIDMSI_STATUS_NORMAL = 0
PIDMSI_STATUS_NEW = PIDMSI_STATUS_NORMAL + 1
PIDMSI_STATUS_PRELIM = PIDMSI_STATUS_NEW + 1
PIDMSI_STATUS_DRAFT = PIDMSI_STATUS_PRELIM + 1
PIDMSI_STATUS_INPROGRESS	= PIDMSI_STATUS_DRAFT + 1
PIDMSI_STATUS_EDIT = PIDMSI_STATUS_INPROGRESS + 1
PIDMSI_STATUS_REVIEW = PIDMSI_STATUS_EDIT + 1
PIDMSI_STATUS_PROOF = PIDMSI_STATUS_REVIEW + 1
PIDMSI_STATUS_FINAL = PIDMSI_STATUS_PROOF + 1
PIDMSI_STATUS_OTHER = $7fff

PRSPEC_INVALID = $ffffffff
PRSPEC_LPWSTR = 0
PRSPEC_PROPID = 1

struct PROPSPEC
       ulKind dd ?,?
       union
	   propid dq ?
	   lpwstr dq ?
       ends
ends

struct STATPROPSTG
       lpwstrName dq ?
       propid dd ?
       vt dw ?,?
ends

PROPSETHDR_OSVERSION_UNKNOWN = $FFFFFFFF

struct STATPROPSETSTG
       fmtid GUID
       clsid GUID
       grfFlags dd ?
       mtime FILETIME
       ctime FILETIME
       atime FILETIME
       dwOSVersion dd ?
ends

;IID_IPropertyStorage GUID $00000138,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IPropertyStorage,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  ReadMultiple,\
	  WriteMultiple,\
	  DeleteMultiple,\
	  ReadPropertyNames,\
	  WritePropertyNames,\
	  DeletePropertyNames,\
	  Commit,\
	  Revert,\
	  Enum,\
	  SetTimes,\
	  SetClass,\
	  Stat

;IID_IPropertySetStorage GUID $0000013A,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IPropertySetStorage,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Create,\
	  Open,\
	  Delete,\
	  Enum

;IID_IEnumSTATPROPSTG GUID $00000139,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IEnumSTATPROPSTG,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Next,\
	  Skip,\
	  Reset,\
	  Clone

;IID_IEnumSTATPROPSETSTG GUID $0000013B,$0000,$0000,<$C0,$00,$00,$00,$00,$00,$00,$46>
interface IEnumSTATPROPSETSTG,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Next,\
	  Skip,\
	  Reset,\
	  Clone

CCH_MAX_PROPSTG_NAME = 31

E_DRAW = VIEW_E_DRAW
DATA_E_FORMATETC = DV_E_FORMATETC

OLE_E_NOEXTENSION = OLE_E_NOSTORAGE + 1
OLE_E_VERSEXTENSION = OLE_E_NOSTORAGE + 2
OLE_E_IPBUSY = OLE_E_NOSTORAGE + 3
OLE_E_NOT_FRONT_PROCESS = OLE_E_NOSTORAGE + 4
OLE_E_WRONG_MENU = OLE_E_NOSTORAGE + 5
OLE_E_MENU_NOT_PATCHED = OLE_E_NOSTORAGE + 6
OLE_E_MENUID_NOT_HASHED = OLE_E_NOSTORAGE + 7

struct DRAGFLAVORINFO
       cfFormat dd ?
       FlavorFlags dd ?
       fAddData dd ?
       reserved dd ?
ends

OLEIVERB_PRIMARY = 0
OLEIVERB_SHOW = -1
OLEIVERB_OPEN = -2
OLEIVERB_HIDE = -3
OLEIVERB_UIACTIVATE = -4
OLEIVERB_INPLACEACTIVATE = -5
OLEIVERB_DISCARDUNDOSTATE = -6

EMBDHLP_INPROC_HANDLER = 0
EMBDHLP_INPROC_SERVER = 1
EMBDHLP_CREATENOW = 0
EMBDHLP_DELAYCREATE = $10000

OLECREATE_LEAVERUNNING = 1

noAxis = 3

struct OLESTREAMVTBL
       Get dq ?
       Put dq ?
ends

struct OLESTREAM
       lpstbl dq ?
ends


;WinSock2.h inaddr.h ws2def.h winnetwk.h Qos2.h ws2tcpip.h ws2spi.h ws2pdef.h ws2bth.h bthdef.h
;bthsdpdef.h ws2atm.h nldef.h in6addr.h

;Winsock2.h -- definitions to be used with the WinSock 2 DLL and
;              WinSock 2 applications.
;
;This header file corresponds to version 2.2.x of the WinSock API
;specification.
;
;This file includes parts which are Copyright (c) 1982-1986 Regents
;of the University of California.  All rights reserved.  The
;Berkeley Software License Agreement specifies the terms and
;conditions for redistribution.
WINSOCK_VERSION = $0202

;Copyright (c) Microsoft Corporation. All rights reserved.
;Module Name: ws2def.h

;Abstract:
;    This file contains the core definitions for the Winsock2
;    specification that can be used by both user-mode and
;    kernel mode modules.
;
;    This file is included in WINSOCK2.H. User mode applications
;    should include WINSOCK2.H rather than including this file
;    directly. This file can not be included by a module that also
;    includes WINSOCK.H.


;Copyright (c) Microsoft Corporation
;Module Name: inaddr.h
INADDR_ANY = 0
INADDR_LOOPBACK = $7f000001
INADDR_BROADCAST = $ffffffff
INADDR_NONE = $ffffffff

struct INADDR
       union
	   struct
	       s_b1 db ?
	       s_b2 db ?
	       s_b3 db ?
	       s_b4 db ?
	   ends
	   struct
	       s_w1 dw ?
	       s_w2 dw ?
	   ends
       ends
ends

AF_UNSPEC = 0
AF_UNIX = 1
AF_INET = 2
AF_IMPLINK = 3
AF_PUP = 4
AF_CHAOS = 5
AF_NS = 6
AF_IPX = AF_NS
AF_ISO = 7
AF_OSI = AF_ISO
AF_ECMA = 8
AF_DATAKIT = 9
AF_CCITT = 10
AF_SNA = 11
AF_DECnet = 12
AF_DLI = 13
AF_LAT = 14
AF_HYLINK = 15
AF_APPLETALK = 16
AF_NETBIOS = 17
AF_VOICEVIEW = 18
AF_FIREFOX = 19
AF_UNKNOWN1 = 20
AF_BAN = 21
AF_ATM = 22
AF_INET6 = 23
AF_CLUSTER = 24
AF_12844 = 25
AF_IRDA = 26
AF_NETDES = 28

AF_TCNPROCESS = 29
AF_TCNMESSAGE = 30
AF_ICLFXBM = 31
AF_MAX = 32 ;AF_MAX          33  (_WIN32_WINNT > 0x0600)
AF_BTH = 32
AF_MAX = 33

SOCK_STREAM = 1
SOCK_DGRAM = 2
SOCK_RAW = 3
SOCK_RDM = 4
SOCK_SEQPACKET = 5

SOL_SOCKET = $ffff

SO_DEBUG = 1
SO_ACCEPTCONN = 2
SO_REUSEADDR = 4
SO_KEEPALIVE = 8
SO_DONTROUTE = $10
SO_BROADCAST = $20
SO_USELOOPBACK = $40
SO_LINGER = $80
SO_OOBINLINE = $100

SO_DONTLINGER = not SO_LINGER
SO_EXCLUSIVEADDRUSE = not SO_REUSEADDR

SO_SNDBUF = 1001
SO_RCVBUF = 1002
SO_SNDLOWAT = 1003
SO_RCVLOWAT = 1004
SO_SNDTIMEO = 1005
SO_RCVTIMEO = 1006
SO_ERROR = 1007
SO_TYPE = 1008
SO_BSP_STATE = 1009
SO_GROUP_ID = 2001
SO_GROUP_PRIORITY = 2002
SO_MAX_MSG_SIZE = 2003
SO_CONDITIONAL_ACCEPT = 3002
SO_PAUSE_ACCEPT = 3003
SO_COMPARTMENT_ID = 3004
SO_RANDOMIZE_PORT = 3005
SO_PORT_SCALABILITY = 3006

WSK_SO_BASE = $4000
TCP_NODELAY = 1

struct SOCKADDR
       sa_family dw ?
       sa_data db 14 dup(?)
ends

struct SOCKPROTO
       sp_family dw ?
       sp_protocol dw ?
ends

struct SOCKETADDRESS
       lpSockaddr dq ?
       iSockaddrLength dd ?,?
ends

struct SOCKETADDRESSLIST
       iAddressCount dd ?,?
       Address SOCKETADDRESS
ends

struct CSADDRINFO
       LocalAddr SOCKETADDRESS
       RemoteAddr SOCKETADDRESS
       iSocketType dd ?
       iProtocol dd ?
ends

_SS_MAXSIZE = 128
_SS_ALIGNSIZE = 8;Desired alignment

_SS_PAD1SIZE = _SS_ALIGNSIZE - sizeof.WORD
_SS_PAD2SIZE = (_SS_MAXSIZE - (sizeof.WORD + _SS_PAD1SIZE + _SS_ALIGNSIZE))

struct SOCKADDRSTORAGE
       ss_family dw ?
       __ss_pad1 db _SS_PAD1SIZE dup(?)
       __ss_align dq ?
       __ss_pad2 db _SS_PAD2SIZE dup(?)
ends

IOC_UNIX = 0
IOC_WS2 = $8000000
IOC_PROTOCOL = $10000000
IOC_VENDOR = $18000000
IOC_WSK = (IOC_WS2 or $7000000)

macro _WSAIO x, y { VALUE = IOC_VOID or (x) or (y) }
macro _WSAIOR x, y { VALUE = IOC_OUT or (x) or (y) }
macro _WSAIOW x, y { VALUE = IOC_IN or (x) or (y) }
macro _WSAIORW x, y { VALUE = IOC_INOUT or (x) or (y) }

_WSAIOW IOC_WS2, 1
SIO_ASSOCIATE_HANDLE = VALUE

_WSAIO IOC_WS2, 2
SIO_ENABLE_CIRCULAR_QUEUEING = VALUE

_WSAIOR IOC_WS2, 3
SIO_FIND_ROUTE = VALUE

_WSAIO IOC_WS2, 4
SIO_FLUSH = VALUE

_WSAIOR IOC_WS2, 5
SIO_GET_BROADCAST_ADDRESS = VALUE

_WSAIORW IOC_WS2, 6
SIO_GET_EXTENSION_FUNCTION_POINTER = VALUE

_WSAIORW IOC_WS2, 7
SIO_GET_QOS = VALUE

_WSAIORW IOC_WS2, 8
SIO_GET_GROUP_QOS = VALUE

_WSAIOW IOC_WS2, 9
SIO_MULTIPOINT_LOOPBACK = VALUE

_WSAIOW IOC_WS2, 10
SIO_MULTICAST_SCOPE = VALUE

_WSAIOW IOC_WS2, 11
SIO_SET_QOS = VALUE

_WSAIOW IOC_WS2, 12
SIO_SET_GROUP_QOS = VALUE

_WSAIORW IOC_WS2, 13
SIO_TRANSLATE_HANDLE = VALUE

_WSAIORW IOC_WS2, 20
SIO_ROUTING_INTERFACE_QUERY = VALUE

_WSAIOW IOC_WS2, 21
SIO_ROUTING_INTERFACE_CHANGE = VALUE

_WSAIOR IOC_WS2, 22
SIO_ADDRESS_LIST_QUERY = VALUE

_WSAIO IOC_WS2, 23
SIO_ADDRESS_LIST_CHANGE = VALUE

_WSAIOR IOC_WS2, 24
SIO_QUERY_TARGET_PNP_HANDLE = VALUE

_WSAIORW IOC_WS2, 25
SIO_ADDRESS_LIST_SORT = VALUE

_WSAIOW IOC_WS2, 26
SIO_RESERVED_1 = VALUE

_WSAIOW IOC_WS2, 33
SIO_RESERVED_2 = VALUE

IPPROTO_IP = 0

IPPROTO_HOPOPTS = 0
IPPROTO_ICMP = 1
IPPROTO_IGMP = 2
IPPROTO_GGP = 3
IPPROTO_IPV4 = 4
IPPROTO_ST = 5
IPPROTO_TCP = 6
IPPROTO_CBT = 7
IPPROTO_EGP = 8
IPPROTO_IGP = 9
IPPROTO_PUP = 12
IPPROTO_UDP = 17
IPPROTO_IDP = 22
IPPROTO_RDP = 27

IPPROTO_IPV6 = 41
IPPROTO_ROUTING = 43
IPPROTO_FRAGMENT = 44
IPPROTO_ESP = 50
IPPROTO_AH = 51
IPPROTO_ICMPV6 = 58
IPPROTO_NONE = 59
IPPROTO_DSTOPTS = 60
IPPROTO_ND = 77
IPPROTO_ICLFXBM = 78
IPPROTO_PIM = 103
IPPROTO_PGM = 113
IPPROTO_L2TP = 115
IPPROTO_SCTP = 132
IPPROTO_RAW = 255
IPPROTO_MAX = 256
IPPROTO_RESERVED_RAW = 257
IPPROTO_RESERVED_IPSEC = 258
IPPROTO_RESERVED_IPSECOFFLOAD = 259
IPPROTO_RESERVED_MAX = 260

IPPORT_TCPMUX = 1
IPPORT_ECHO = 7
IPPORT_DISCARD = 9
IPPORT_SYSTAT = 11
IPPORT_DAYTIME = 13
IPPORT_NETSTAT = 15
IPPORT_QOTD = 17
IPPORT_MSP = 18
IPPORT_CHARGEN = 19
IPPORT_FTP_DATA = 20
IPPORT_FTP = 21
IPPORT_TELNET = 23
IPPORT_SMTP = 25
IPPORT_TIMESERVER = 37
IPPORT_NAMESERVER = 42
IPPORT_WHOIS = 43
IPPORT_MTP = 57

IPPORT_TFTP = 69
IPPORT_RJE = 77
IPPORT_FINGER = 79
IPPORT_TTYLINK = 87
IPPORT_SUPDUP = 95
IPPORT_POP3 = 110
IPPORT_NTP = 123
IPPORT_EPMAP = 135
IPPORT_NETBIOS_NS = 137
IPPORT_NETBIOS_DGM = 138
IPPORT_NETBIOS_SSN = 139
IPPORT_IMAP = 143
IPPORT_SNMP = 161
IPPORT_SNMP_TRAP = 162
IPPORT_IMAP3 = 220
IPPORT_LDAP = 389
IPPORT_HTTPS = 443
IPPORT_MICROSOFT_DS = 445
IPPORT_EXECSERVER = 512
IPPORT_LOGINSERVER = 513
IPPORT_CMDSERVER = 514
IPPORT_EFSSERVER = 520
IPPORT_BIFFUDP = 512
IPPORT_WHOSERVER = 513
IPPORT_ROUTESERVER = 520
IPPORT_RESERVED = 1024
IPPORT_REGISTERED_MIN = IPPORT_RESERVED
IPPORT_REGISTERED_MAX = $bfff
IPPORT_DYNAMIC_MIN = $c000
IPPORT_DYNAMIC_MAX = $ffff

;IN_CLASSA(i)            (((LONG)(i) & 0x80000000) == 0)
IN_CLASSA_NET = $ff000000
IN_CLASSA_NSHIFT = 24
IN_CLASSA_HOST = $ffffff
IN_CLASSA_MAX = 128

;IN_CLASSB(i)            (((LONG)(i) & 0xc0000000) == 0x80000000)
IN_CLASSB_NET = $ffff0000
IN_CLASSB_NSHIFT = 16
IN_CLASSB_HOST = $ffff
IN_CLASSB_MAX = 65536

;IN_CLASSC(i)            (((LONG)(i) & 0xe0000000) == 0xc0000000)
IN_CLASSC_NET = $ffffff00
IN_CLASSC_NSHIFT = 8
IN_CLASSC_HOST = $ff

;IN_CLASSD(i)            (((long)(i) & 0xf0000000) == 0xe0000000)
IN_CLASSD_NET = $f0000000
IN_CLASSD_NSHIFT = 28
IN_CLASSD_HOST = $fffffff
;#define IN_MULTICAST(i)         = (((long)(i) & 0xf0000000) == 0xe0000000)

;INADDR_ANY              (ULONG)0x00000000
INADDR_LOOPBACK = $7f000001
INADDR_BROADCAST = $ffffffff
INADDR_NONE = $ffffffff

ScopeLevelInterface = 1
ScopeLevelLink = 2
ScopeLevelSubnet = 3
ScopeLevelAdmin = 4
ScopeLevelSite = 5
ScopeLevelOrganization = 8
ScopeLevelGlobal = 14
ScopeLevelCount = 16

struct SCOPEID
       union
	   union
	       Zone dd ? ;Zone : 28
	       Level dd ? ;Level : 4
	   ends
	   Value dd ?
       ends
ends

SCOPEID_UNSPECIFIED_INIT = 0

struct SOCKADDRIN
       sin_family dw ?
       sin_port dw ?
       sin_addr INADDR
       sin_zero db 8 dup(?)
ends

IOCPARM_MASK = $7f
IOC_VOID = $20000000
IOC_OUT = $40000000
IOC_IN = $80000000
IOC_INOUT = (IOC_IN or IOC_OUT)

macro _IO x, y { VALUE = IOC_VOID or ((x shl 8)| (y)) }
macro _IOR x, y, t { VALUE = IOC_OUT or (( t and IOCPARM_MASK ) shl 16) or ((x) shl 8) or (y) }
macro _IOW x, y, t { VALUE = IOC_IN or (( t and IOCPARM_MASK ) shl 16) or ((x) shl 8) or (y) }

struct WSABUF
       len dd ?,?
       buf dq ?
ends

struct WSAMSG
       name dq ?
       namelen dd ?,?
       lpBuffers dq ?
       dwBufferCount dd ?,?
       Control WSABUF
       dwFlags dd ?,?
ends

struct WSACMSGHDR
       cmsg_len dq ?
       cmsg_level dd ?
       cmsg_type dd ?
ends

MSG_TRUNC = $100
MSG_CTRUNC = $200
MSG_BCAST = $400
MSG_MCAST = $800

FD_SETSIZE = 64

struct FDSET
       fd_count dd ?,?
       fd_array dq FD_SETSIZE dup(?)
ends

struct TIMEVAL
       tv_sec dd ?
       tv_usec dd ?
ends

_IOR 'f', 127, sizeof.LONG
FIONREAD = VALUE
_IOW 'f', 126, sizeof.LONG
FIONBIO = VALUE
_IOW 'f', 125, sizeof.LONG
FIOASYNC = VALUE
_IOW 's',  0, sizeof.LONG
SIOCSHIWAT = VALUE
_IOR 's',  1, sizeof.LONG
SIOCGHIWAT = VALUE
_IOW 's',  2, sizeof.LONG
SIOCSLOWAT = VALUE
_IOR 's',  3, sizeof.LONG
SIOCGLOWAT = VALUE
_IOR 's',  7, sizeof.LONG
SIOCATMARK = VALUE

struct HOSTENT
       h_name dq ?
       h_aliases dq ?
       h_addrtype dw ?
       h_length dw ?,?,?
       h_addr_list dq ?
ends

struct NETENT
       n_name dq ?
       n_aliases dq ?
       n_addrtype dw ?
       n_net dd ?
       dw ?
ends

struct SERVENT
       s_name dd ?
       s_aliases dd ?
       s_proto dd ?
       s_port dw ?,?
ends

struct PROTOENT
       p_name dq ?
       p_aliases dq ?
       p_proto dw ?,?,?,?
ends

IPPORT_ECHO = 7
IPPORT_DISCARD = 9
IPPORT_SYSTAT = 11
IPPORT_DAYTIME = 13
IPPORT_NETSTAT = 15
IPPORT_FTP = 21
IPPORT_TELNET = 23
IPPORT_SMTP = 25
IPPORT_TIMESERVER = 37
IPPORT_NAMESERVER = 42
IPPORT_WHOIS = 43
IPPORT_MTP = 57
IPPORT_TFTP = 69
IPPORT_RJE = 77
IPPORT_FINGER = 79
IPPORT_TTYLINK = 87
IPPORT_SUPDUP = 95
IPPORT_EXECSERVER = 512
IPPORT_LOGINSERVER = 513
IPPORT_CMDSERVER = 514
IPPORT_EFSSERVER = 520
IPPORT_BIFFUDP = 512
IPPORT_WHOSERVER = 513
IPPORT_ROUTESERVER = 520
IPPORT_RESERVED = 1024
IMPLINK_IP = 155
IMPLINK_LOWEXPER = 156
IMPLINK_HIGHEXPER = 158

ADDR_ANY = INADDR_ANY
WSADESCRIPTION_LEN = 256
WSASYS_STATUS_LEN = 128

struct WSADATA
       wVersion dw ?
       wHighVersion dw ?
       iMaxSockets dw ?
       iMaxUdpDg dw ?
       lpVendorInfo dq ?
       szDescription db WSADESCRIPTION_LEN+1 dup(?)
       szSystemStatus db WSASYS_STATUS_LEN+7 dup(?)
ends

INVALID_SOCKET = not 0
SOCKET_ERROR = -1
FROM_PROTOCOL_INFO = -1

SOCK_STREAM = 1
SOCK_DGRAM = 2
SOCK_RAW = 3
SOCK_RDM = 4
SOCK_SEQPACKET = 5

SO_DEBUG = 1
SO_ACCEPTCONN = 2
SO_REUSEADDR = 4
SO_KEEPALIVE = 8
SO_DONTROUTE = $10
SO_BROADCAST = $20
SO_USELOOPBACK = $40
SO_LINGER = $80
SO_OOBINLINE = $100
SO_DONTLINGER = not SO_LINGER
SO_EXCLUSIVEADDRUSE = not SO_REUSEADDR
SO_SNDBUF = $1001
SO_RCVBUF = $1002
SO_SNDLOWAT = $1003
SO_RCVLOWAT = $1004
SO_SNDTIMEO = $1005
SO_RCVTIMEO = $1006
SO_ERROR = $1007
SO_TYPE = $1008
SO_GROUP_ID = $2001
SO_GROUP_PRIORITY = $2002
SO_MAX_MSG_SIZE = $2003
SO_PROTOCOL_INFOA = $2004
SO_PROTOCOL_INFOW = $2005
;#ifdef (UNICODE)  #define SO_PROTOCOL_INFO  SO_PROTOCOL_INFOW
SO_PROTOCOL_INFO = SO_PROTOCOL_INFOA
PVD_CONFIG = $3001
SO_CONDITIONAL_ACCEPT = $3002

struct IPMREQ
       imr_multiaddr INADDR
       imr_interface INADDR
ends

PF_UNSPEC = AF_UNSPEC
PF_UNIX = AF_UNIX
PF_INET = AF_INET
PF_IMPLINK = AF_IMPLINK
PF_PUP = AF_PUP
PF_CHAOS = AF_CHAOS
PF_NS = AF_NS
PF_IPX = AF_IPX
PF_ISO = AF_ISO
PF_OSI = AF_OSI
PF_ECMA = AF_ECMA
PF_DATAKIT = AF_DATAKIT
PF_CCITT = AF_CCITT
PF_SNA = AF_SNA
PF_DECnet = AF_DECnet
PF_DLI = AF_DLI
PF_LAT = AF_LAT
PF_HYLINK = AF_HYLINK
PF_APPLETALK = AF_APPLETALK
PF_VOICEVIEW = AF_VOICEVIEW
PF_FIREFOX = AF_FIREFOX
PF_UNKNOWN1 = AF_UNKNOWN1
PF_BAN = AF_BAN
PF_ATM = AF_ATM
PF_INET6 = AF_INET6
PF_BTH = AF_BTH
PF_MAX = AF_MAX

struct LINGER
       l_onoff dw ?
       l_linger dw ?
ends

SOL_SOCKET = $ffff
SOMAXCONN = $7fffffff
MSG_OOB = 1
MSG_PEEK = 2
MSG_DONTROUTE = 4
MSG_WAITALL = 8
MSG_PARTIAL = $8000
MSG_INTERRUPT = $10
MSG_MAXIOVLEN = 16
MAXGETHOSTSTRUCT = 1024

FD_READ_BIT = 0
FD_READ = (1 shl FD_READ_BIT)
FD_WRITE_BIT = 1
FD_WRITE = (1 shl FD_WRITE_BIT)
FD_OOB_BIT = 2
FD_OOB = (1 shl FD_OOB_BIT)
FD_ACCEPT_BIT = 3
FD_ACCEPT = (1 shl FD_ACCEPT_BIT)
FD_CONNECT_BIT = 4
FD_CONNECT = (1 shl FD_CONNECT_BIT)
FD_CLOSE_BIT = 5
FD_CLOSE = (1 shl FD_CLOSE_BIT)
FD_QOS_BIT = 6
FD_QOS = (1 shl FD_QOS_BIT)
FD_GROUP_QOS_BIT = 7
FD_GROUP_QOS = (1 shl FD_GROUP_QOS_BIT)
FD_ROUTING_INTERFACE_CHANGE_BIT = 8
FD_ROUTING_INTERFACE_CHANGE = (1 shl FD_ROUTING_INTERFACE_CHANGE_BIT)
FD_ADDRESS_LIST_CHANGE_BIT = 9
FD_ADDRESS_LIST_CHANGE = (1 shl FD_ADDRESS_LIST_CHANGE_BIT)
FD_MAX_EVENTS = 10
FD_ALL_EVENTS = ((1 shl FD_MAX_EVENTS) - 1)

WSABASEERR = 10000
WSAEINTR = (WSABASEERR+4)
WSAEBADF = (WSABASEERR+9)
WSAEACCES = (WSABASEERR+13)
WSAEFAULT = (WSABASEERR+14)
WSAEINVAL = (WSABASEERR+22)
WSAEMFILE = (WSABASEERR+24)
WSAEWOULDBLOCK = (WSABASEERR+35)
WSAEINPROGRESS = (WSABASEERR+36)
WSAEALREADY = (WSABASEERR+37)
WSAENOTSOCK = (WSABASEERR+38)
WSAEDESTADDRREQ = (WSABASEERR+39)
WSAEMSGSIZE = (WSABASEERR+40)
WSAEPROTOTYPE = (WSABASEERR+41)
WSAENOPROTOOPT = (WSABASEERR+42)
WSAEPROTONOSUPPORT = (WSABASEERR+43)
WSAESOCKTNOSUPPORT = (WSABASEERR+44)
WSAEOPNOTSUPP = (WSABASEERR+45)
WSAEPFNOSUPPORT = (WSABASEERR+46)
WSAEAFNOSUPPORT = (WSABASEERR+47)
WSAEADDRINUSE = (WSABASEERR+48)
WSAEADDRNOTAVAIL = (WSABASEERR+49)
WSAENETDOWN = (WSABASEERR+50)
WSAENETUNREACH = (WSABASEERR+51)
WSAENETRESET = (WSABASEERR+52)
WSAECONNABORTED = (WSABASEERR+53)
WSAECONNRESET = (WSABASEERR+54)
WSAENOBUFS = (WSABASEERR+55)
WSAEISCONN = (WSABASEERR+56)
WSAENOTCONN = (WSABASEERR+57)
WSAESHUTDOWN = (WSABASEERR+58)
WSAETOOMANYREFS = (WSABASEERR+59)
WSAETIMEDOUT = (WSABASEERR+60)
WSAECONNREFUSED = (WSABASEERR+61)
WSAELOOP = (WSABASEERR+62)
WSAENAMETOOLONG = (WSABASEERR+63)
WSAEHOSTDOWN = (WSABASEERR+64)
WSAEHOSTUNREACH = (WSABASEERR+65)
WSAENOTEMPTY = (WSABASEERR+66)
WSAEPROCLIM = (WSABASEERR+67)
WSAEUSERS = (WSABASEERR+68)
WSAEDQUOT = (WSABASEERR+69)
WSAESTALE = (WSABASEERR+70)
WSAEREMOTE = (WSABASEERR+71)
WSASYSNOTREADY = (WSABASEERR+91)
WSAVERNOTSUPPORTED = (WSABASEERR+92)
WSANOTINITIALISED = (WSABASEERR+93)
WSAEDISCON = (WSABASEERR+101)
WSAENOMORE = (WSABASEERR+102)
WSAECANCELLED = (WSABASEERR+103)
WSAEINVALIDPROCTABLE = (WSABASEERR+104)
WSAEINVALIDPROVIDER = (WSABASEERR+105)
WSAEPROVIDERFAILEDINIT = (WSABASEERR+106)
WSASYSCALLFAILURE = (WSABASEERR+107)
WSASERVICE_NOT_FOUND = (WSABASEERR+108)
WSATYPE_NOT_FOUND = (WSABASEERR+109)
WSA_E_NO_MORE = (WSABASEERR+110)
WSA_E_CANCELLED = (WSABASEERR+111)
WSAEREFUSED = (WSABASEERR+112)

WSAHOST_NOT_FOUND = (WSABASEERR+1001)
WSATRY_AGAIN = (WSABASEERR+1002)
WSANO_RECOVERY = (WSABASEERR+1003)
WSANO_DATA = (WSABASEERR+1004)

WSA_QOS_RECEIVERS = (WSABASEERR + 1005)
WSA_QOS_SENDERS = (WSABASEERR + 1006)
WSA_QOS_NO_SENDERS = (WSABASEERR + 1007)
WSA_QOS_NO_RECEIVERS = (WSABASEERR + 1008)
WSA_QOS_REQUEST_CONFIRMED = (WSABASEERR + 1009)
WSA_QOS_ADMISSION_FAILURE = (WSABASEERR + 1010)
WSA_QOS_POLICY_FAILURE = (WSABASEERR + 1011)
WSA_QOS_BAD_STYLE = (WSABASEERR + 1012)
WSA_QOS_BAD_OBJECT = (WSABASEERR + 1013)
WSA_QOS_TRAFFIC_CTRL_ERROR = (WSABASEERR + 1014)
WSA_QOS_GENERIC_ERROR = (WSABASEERR + 1015)
WSA_QOS_ESERVICETYPE = (WSABASEERR + 1016)
WSA_QOS_EFLOWSPEC = (WSABASEERR + 1017)
WSA_QOS_EPROVSPECBUF = (WSABASEERR + 1018)
WSA_QOS_EFILTERSTYLE = (WSABASEERR + 1019)
WSA_QOS_EFILTERTYPE = (WSABASEERR + 1020)
WSA_QOS_EFILTERCOUNT = (WSABASEERR + 1021)
WSA_QOS_EOBJLENGTH = (WSABASEERR + 1022)
WSA_QOS_EFLOWCOUNT = (WSABASEERR + 1023)
WSA_QOS_EUNKOWNPSOBJ = (WSABASEERR + 1024)
WSA_QOS_EPOLICYOBJ = (WSABASEERR + 1025)
WSA_QOS_EFLOWDESC = (WSABASEERR + 1026)
WSA_QOS_EPSFLOWSPEC = (WSABASEERR + 1027)
WSA_QOS_EPSFILTERSPEC = (WSABASEERR + 1028)
WSA_QOS_ESDMODEOBJ = (WSABASEERR + 1029)
WSA_QOS_ESHAPERATEOBJ = (WSABASEERR + 1030)
WSA_QOS_RESERVED_PETYPE = (WSABASEERR + 1031)

HOST_NOT_FOUND = WSAHOST_NOT_FOUND
TRY_AGAIN = WSATRY_AGAIN
NO_RECOVERY = WSANO_RECOVERY
NO_DATA = WSANO_DATA
WSANO_ADDRESS = WSANO_DATA
NO_ADDRESS = WSANO_ADDRESS

EWOULDBLOCK = WSAEWOULDBLOCK
EINPROGRESS = WSAEINPROGRESS
EALREADY = WSAEALREADY
ENOTSOCK = WSAENOTSOCK
EDESTADDRREQ = WSAEDESTADDRREQ
EMSGSIZE = WSAEMSGSIZE
EPROTOTYPE = WSAEPROTOTYPE
ENOPROTOOPT = WSAENOPROTOOPT
EPROTONOSUPPORT = WSAEPROTONOSUPPORT
ESOCKTNOSUPPORT = WSAESOCKTNOSUPPORT
EOPNOTSUPP = WSAEOPNOTSUPP
EPFNOSUPPORT = WSAEPFNOSUPPORT
EAFNOSUPPORT = WSAEAFNOSUPPORT
EADDRINUSE = WSAEADDRINUSE
EADDRNOTAVAIL = WSAEADDRNOTAVAIL
ENETDOWN = WSAENETDOWN
ENETUNREACH = WSAENETUNREACH
ENETRESET = WSAENETRESET
ECONNABORTED = WSAECONNABORTED
ECONNRESET = WSAECONNRESET
ENOBUFS = WSAENOBUFS
EISCONN = WSAEISCONN
ENOTCONN = WSAENOTCONN
ESHUTDOWN = WSAESHUTDOWN
ETOOMANYREFS = WSAETOOMANYREFS
ETIMEDOUT = WSAETIMEDOUT
ECONNREFUSED = WSAECONNREFUSED
ELOOP = WSAELOOP
ENAMETOOLONG = WSAENAMETOOLONG
EHOSTDOWN = WSAEHOSTDOWN
EHOSTUNREACH = WSAEHOSTUNREACH
ENOTEMPTY = WSAENOTEMPTY
EPROCLIM = WSAEPROCLIM
EUSERS = WSAEUSERS
EDQUOT = WSAEDQUOT
ESTALE = WSAESTALE
EREMOTE = WSAEREMOTE

;WSAAPI        FAR PASCAL
;WSAEVENT      HANDLE
;LPWSAEVENT    LPHANDLE
;WSAOVERLAPPED OVERLAPPED

WSA_IO_PENDING = ERROR_IO_PENDING
WSA_IO_INCOMPLETE = ERROR_IO_INCOMPLETE
WSA_INVALID_HANDLE = ERROR_INVALID_HANDLE
WSA_INVALID_PARAMETER = ERROR_INVALID_PARAMETER
WSA_NOT_ENOUGH_MEMORY = ERROR_NOT_ENOUGH_MEMORY
WSA_OPERATION_ABORTED = ERROR_OPERATION_ABORTED

WSA_INVALID_EVENT = NULL
WSA_MAXIMUM_WAIT_EVENTS = MAXIMUM_WAIT_OBJECTS
WSA_WAIT_FAILED = WAIT_FAILED
WSA_WAIT_EVENT_0 = WAIT_OBJECT_0
WSA_WAIT_IO_COMPLETION = WAIT_IO_COMPLETION
WSA_WAIT_TIMEOUT = WAIT_TIMEOUT
WSA_INFINITE = INFINITE

;Copyright (c) Microsoft Corporation. All rights reserved.
;Module Name:  winnetwk.h
;Abstract:  Standard WINNET Header File for WIN32
;Environment:  User Mode -Win32

WNNC_NET_MSNET = $10000
WNNC_NET_LANMAN = $20000
WNNC_NET_NETWARE = $30000
WNNC_NET_VINES = $40000
WNNC_NET_10NET = $50000
WNNC_NET_LOCUS = $60000
WNNC_NET_SUN_PC_NFS = $70000
WNNC_NET_LANSTEP = $80000
WNNC_NET_9TILES = $90000
WNNC_NET_LANTASTIC = $A0000
WNNC_NET_AS400 = $B0000
WNNC_NET_FTP_NFS = $C0000
WNNC_NET_PATHWORKS = $D0000
WNNC_NET_LIFENET = $E0000
WNNC_NET_POWERLAN = $F0000
WNNC_NET_BWNFS = $100000
WNNC_NET_COGENT = $110000
WNNC_NET_FARALLON = $120000
WNNC_NET_APPLETALK = $130000
WNNC_NET_INTERGRAPH = $140000
WNNC_NET_SYMFONET = $150000
WNNC_NET_CLEARCASE = $160000
WNNC_NET_FRONTIER = $170000
WNNC_NET_BMC = $180000
WNNC_NET_DCE = $190000
WNNC_NET_AVID = $1A0000
WNNC_NET_DOCUSPACE = $1B0000
WNNC_NET_MANGOSOFT = $1C0000
WNNC_NET_SERNET = $1D0000
WNNC_NET_RIVERFRONT1 = $1E0000
WNNC_NET_RIVERFRONT2 = $1F0000
WNNC_NET_DECORB = $200000
WNNC_NET_PROTSTOR = $210000
WNNC_NET_FJ_REDIR = $220000
WNNC_NET_DISTINCT = $230000
WNNC_NET_TWINS = $240000
WNNC_NET_RDR2SAMPLE = $250000
WNNC_NET_CSC = $260000
WNNC_NET_3IN1 = $270000
WNNC_NET_EXTENDNET = $290000
WNNC_NET_STAC = $2A0000
WNNC_NET_FOXBAT = $2B0000
WNNC_NET_YAHOO = $2C0000
WNNC_NET_EXIFS = $2D0000
WNNC_NET_DAV = $2E0000
WNNC_NET_KNOWARE = $2F0000
WNNC_NET_OBJECT_DIRE = $300000
WNNC_NET_MASFAX = $310000
WNNC_NET_HOB_NFS = $320000
WNNC_NET_SHIVA = $330000
WNNC_NET_IBMAL = $340000
WNNC_NET_LOCK = $350000
WNNC_NET_TERMSRV = $360000
WNNC_NET_SRT = $370000
WNNC_NET_QUINCY = $380000
WNNC_NET_OPENAFS = $390000
WNNC_NET_AVID1 = $3A0000
WNNC_NET_DFS = $3B0000
WNNC_NET_KWNP = $3C0000
WNNC_NET_ZENWORKS = $3D0000
WNNC_NET_DRIVEONWEB = $3E0000
WNNC_NET_VMWARE = $3F0000
WNNC_NET_RSFX = $400000
WNNC_NET_MFILES = $410000
WNNC_NET_MS_NFS = $420000
WNNC_NET_GOOGLE = $430000
WNNC_CRED_MANAGER = $FFFF0000

RESOURCE_CONNECTED = 1
RESOURCE_GLOBALNET = 2
RESOURCE_REMEMBERED = 3
RESOURCE_RECENT = 4
RESOURCE_CONTEXT = 5

RESOURCETYPE_ANY = 0
RESOURCETYPE_DISK = 1
RESOURCETYPE_PRINT = 2
RESOURCETYPE_RESERVED = 8
RESOURCETYPE_UNKNOWN = $FFFFFFFF

RESOURCEUSAGE_CONNECTABLE = 1
RESOURCEUSAGE_CONTAINER = 2
RESOURCEUSAGE_NOLOCALDEVICE = 4
RESOURCEUSAGE_SIBLING = 8
RESOURCEUSAGE_ATTACHED = $10
RESOURCEUSAGE_ALL = (RESOURCEUSAGE_CONNECTABLE or RESOURCEUSAGE_CONTAINER or\
		     RESOURCEUSAGE_ATTACHED)
RESOURCEUSAGE_RESERVED = $80000000

RESOURCEDISPLAYTYPE_GENERIC = 0
RESOURCEDISPLAYTYPE_DOMAIN = 1
RESOURCEDISPLAYTYPE_SERVER = 2
RESOURCEDISPLAYTYPE_SHARE = 3
RESOURCEDISPLAYTYPE_FILE = 4
RESOURCEDISPLAYTYPE_GROUP = 5
RESOURCEDISPLAYTYPE_NETWORK = 6
RESOURCEDISPLAYTYPE_ROOT = 7
RESOURCEDISPLAYTYPE_SHAREADMIN = 8
RESOURCEDISPLAYTYPE_DIRECTORY = 9
RESOURCEDISPLAYTYPE_TREE = $A
RESOURCEDISPLAYTYPE_NDSCONTAINER = $B

struct NETRESOURCEA
       dwScope dd ?
       dwType dd ?
       dwDisplayType dd ?
       dwUsage dd ?
       lpLocalName dq ?
       lpRemoteName dq ?
       lpComment dq ?
       lpProvider dq ?
ends

struct NETRESOURCEW
       dwScope dd ?
       dwType dd ?
       dwDisplayType dd ?
       dwUsage dd ?
       lpLocalName dq ?
       lpRemoteName dq ?
       lpComment dq ?
       lpProvider dq ?
ends

NETPROPERTY_PERSISTENT = 1
CONNECT_UPDATE_PROFILE = 1
CONNECT_UPDATE_RECENT = 2
CONNECT_TEMPORARY = 4
CONNECT_INTERACTIVE = 8
CONNECT_PROMPT = $10
CONNECT_NEED_DRIVE = $20
CONNECT_REFCOUNT = $40
CONNECT_REDIRECT = $80
CONNECT_LOCALDRIVE = $100
CONNECT_CURRENT_MEDIA = $200
CONNECT_DEFERRED = $400
CONNECT_RESERVED = $FF000000
CONNECT_COMMANDLINE = $800
CONNECT_CMD_SAVECRED = $1000
CONNECT_CRED_RESET = $2000

struct CONNECTDLGSTRUCTA
       cbStructure dd ?,?
       hwndOwner dq ?
       lpConnRes dq ?
       dwFlags dd ?
       dwDevNum dd ?
ends

struct CONNECTDLGSTRUCTW
       cbStructure dd ?,?
       hwndOwner dq ?
       lpConnRes dq ?
       dwFlags dd ?
       dwDevNum dd ?
ends

CONNDLG_RO_PATH = 1
CONNDLG_CONN_POINT = 2
CONNDLG_USE_MRU = 4
CONNDLG_HIDE_BOX = 8
CONNDLG_PERSIST = $10
CONNDLG_NOT_PERSIST = $20

struct DISCDLGSTRUCTA
       cbStructure dd ?,?
       hwndOwner dq ?
       lpLocalName dq ?
       lpRemoteName dq ?
       dwFlags dd ?,?
ends

struct DISCDLGSTRUCTW
       cbStructure dd ?,?
       hwndOwner dq ?
       lpLocalName dq ?
       lpRemoteName dq ?
       dwFlags dd ?,?
ends

DISC_UPDATE_PROFILE = 1
DISC_NO_FORCE = $40

UNIVERSAL_NAME_INFO_LEVEL = 1
REMOTE_NAME_INFO_LEVEL = 2

struct UNIVERSALNAMEINFOA
       lpUniversalName dq ?
ends

struct UNIVERSALNAMEINFOW
       lpUniversalName dq ?
ends

struct REMOTENAMEINFOA
       lpUniversalName dq ?
       lpConnectionName dq ?
       lpRemainingPath dq ?
ends

struct REMOTENAMEINFOW
       lpUniversalName dq ?
       lpConnectionName dq ?
       lpRemainingPath dq ?
ends

WNFMT_MULTILINE = 1
WNFMT_ABBREVIATED = 2
WNFMT_INENUM = $10
WNFMT_CONNECTION = $20

struct NETINFOSTRUCT
       cbStructure dd ?
       dwProviderVersion dd ?
       dwStatus dd ?
       dwCharacteristics dd ?
       dwHandle dq ?
       wNetType dw ?,?
       dwPrinters dd ?
       dwDrives dd ?,?
ends

NETINFO_DLL16 = 1
NETINFO_DISKRED = 4
NETINFO_PRINTERRED = 8

WN_SUCCESS = NO_ERROR
WN_NO_ERROR = NO_ERROR
WN_NOT_SUPPORTED = ERROR_NOT_SUPPORTED
WN_CANCEL = ERROR_CANCELLED
WN_RETRY = ERROR_RETRY
WN_NET_ERROR = ERROR_UNEXP_NET_ERR
WN_MORE_DATA = ERROR_MORE_DATA
WN_BAD_POINTER = ERROR_INVALID_ADDRESS
WN_BAD_VALUE = ERROR_INVALID_PARAMETER
WN_BAD_USER = ERROR_BAD_USERNAME
WN_BAD_PASSWORD = ERROR_INVALID_PASSWORD
WN_ACCESS_DENIED = ERROR_ACCESS_DENIED
WN_FUNCTION_BUSY = ERROR_BUSY
WN_WINDOWS_ERROR = ERROR_UNEXP_NET_ERR
WN_OUT_OF_MEMORY = ERROR_NOT_ENOUGH_MEMORY
WN_NO_NETWORK = ERROR_NO_NETWORK
WN_EXTENDED_ERROR = ERROR_EXTENDED_ERROR
WN_BAD_LEVEL = ERROR_INVALID_LEVEL
WN_BAD_HANDLE = ERROR_INVALID_HANDLE
WN_NOT_INITIALIZING = ERROR_ALREADY_INITIALIZED
WN_NO_MORE_DEVICES = ERROR_NO_MORE_DEVICES
WN_NOT_CONNECTED = ERROR_NOT_CONNECTED
WN_OPEN_FILES = ERROR_OPEN_FILES
WN_DEVICE_IN_USE = ERROR_DEVICE_IN_USE
WN_BAD_NETNAME = ERROR_BAD_NET_NAME
WN_BAD_LOCALNAME = ERROR_BAD_DEVICE
WN_ALREADY_CONNECTED = ERROR_ALREADY_ASSIGNED
WN_DEVICE_ERROR = ERROR_GEN_FAILURE
WN_CONNECTION_CLOSED = ERROR_CONNECTION_UNAVAIL
WN_NO_NET_OR_BAD_PATH = ERROR_NO_NET_OR_BAD_PATH
WN_BAD_PROVIDER = ERROR_BAD_PROVIDER
WN_CANNOT_OPEN_PROFILE = ERROR_CANNOT_OPEN_PROFILE
WN_BAD_PROFILE = ERROR_BAD_PROFILE
WN_BAD_DEV_TYPE = ERROR_BAD_DEV_TYPE
WN_DEVICE_ALREADY_REMEMBERED = ERROR_DEVICE_ALREADY_REMEMBERED
WN_CONNECTED_OTHER_PASSWORD = ERROR_CONNECTED_OTHER_PASSWORD
WN_CONNECTED_OTHER_PASSWORD_DEFAULT = ERROR_CONNECTED_OTHER_PASSWORD_DEFAULT

WN_NO_MORE_ENTRIES = ERROR_NO_MORE_ITEMS
WN_NOT_CONTAINER = ERROR_NOT_CONTAINER

WN_NOT_AUTHENTICATED = ERROR_NOT_AUTHENTICATED
WN_NOT_LOGGED_ON = ERROR_NOT_LOGGED_ON
WN_NOT_VALIDATED = ERROR_NO_LOGON_SERVERS

struct NETCONNECTINFOSTRUCT
       cbStructure dd ?
       dwFlags dd ?
       dwSpeed dd ?
       dwDelay dd ?
       dwOptDataSize dd ?
ends

WNCON_FORNETCARD = 1
WNCON_NOTROUTED = 2
WNCON_SLOWLINK = 4
WNCON_DYNAMIC = 8

;Copyright (c) Microsoft Corporation. All rights reserved.
;Module Name:  qos.h - QoS definitions for NDIS components.
;Abstract:
;    This module defines the Quality of Service structures and types used
;    by Winsock applications.
;
;WARNING:
;    This api is deprecated and will be removed in a future release of Windows.
;    Please use the QOS2.h api.
SERVICETYPE_NOTRAFFIC = 0
SERVICETYPE_BESTEFFORT = 1
SERVICETYPE_CONTROLLEDLOAD = 2
SERVICETYPE_GUARANTEED = 3
SERVICETYPE_NETWORK_UNAVAILABLE = 4
SERVICETYPE_GENERAL_INFORMATION = 5
SERVICETYPE_NOCHANGE = 6
SERVICETYPE_NONCONFORMING = 9
SERVICETYPE_NETWORK_CONTROL = $A
SERVICETYPE_QUALITATIVE = $D

SERVICE_BESTEFFORT = $80010000
SERVICE_CONTROLLEDLOAD = $80020000
SERVICE_GUARANTEED = $80040000
SERVICE_QUALITATIVE = $80200000

SERVICE_NO_TRAFFIC_CONTROL = $81000000
SERVICE_NO_QOS_SIGNALING = $40000000

struct FLOWSPEC
       TokenRate dd ?
       TokenBucketSize dd ?
       PeakBandwidth dd ?
       Latency dd ?
       DelayVariation dd ?
       ServiceType dd ?
       MaxSduSize dd ?
       MinimumPolicedSize dd ?
ends

QOS_NOT_SPECIFIED = $FFFFFFFF

POSITIVE_INFINITY_RATE = $FFFFFFFE

struct QOSOBJECTHDR
       ObjectType dd ?
       ObjectLength dd ?
ends

QOS_GENERAL_ID_BASE = 2000
QOS_OBJECT_END_OF_LIST = (1 + QOS_GENERAL_ID_BASE)
QOS_OBJECT_SD_MODE = (2 + QOS_GENERAL_ID_BASE)
QOS_OBJECT_SHAPING_RATE = (3 + QOS_GENERAL_ID_BASE)
QOS_OBJECT_DESTADDR = (4 + QOS_GENERAL_ID_BASE)

struct QOSSDMODE
       ObjectHdr QOSOBJECTHDR
       ShapeDiscardMode dd ?
ends

TC_NONCONF_BORROW = 0
TC_NONCONF_SHAPE = 1
TC_NONCONF_DISCARD = 2
TC_NONCONF_BORROW_PLUS = 3

struct QOSSHAPINGRATE
       ObjectHdr QOSOBJECTHDR
       ShapingRate dd ?
ends

;Copyright (c) 2004  Microsoft Corporation
;Module Name: qos2.h
;Abstract:  This module contains QOS structures and function headers
UDP_NOCHECKSUM = 1
UDP_CHECKSUM_COVERAGE = 20

EAI_AGAIN = WSATRY_AGAIN
EAI_BADFLAGS = WSAEINVAL
EAI_FAIL = WSANO_RECOVERY
EAI_FAMILY = WSAEAFNOSUPPORT
EAI_MEMORY = WSA_NOT_ENOUGH_MEMORY
EAI_NONAME = WSAHOST_NOT_FOUND
EAI_SERVICE = WSATYPE_NOT_FOUND
EAI_SOCKTYPE = WSAESOCKTNOSUPPORT
EAI_NODATA = EAI_NONAME

struct ADDRINFOA
       ai_flags dd ?
       ai_family dd ?
       ai_socktype dd ?
       ai_protocol dd ?
       ai_addrlen dq ?
       ai_canonname dq ?
       ai_addr dq ?
       ai_next dq ?
ends

struct ADDRINFOW
       ai_flags dd ?
       ai_family dd ?
       ai_socktype dd ?
       ai_protocol dd ?
       ai_addrlen dq ?
       ai_canonname dq ?
       ai_addr dq ?
       ai_next dq ?
ends

struct ADDRINFOEXA
       ai_flags dd ?
       ai_family dd ?
       ai_socktype dd ?
       ai_protocol dd ?
       ai_addrlen dq ?
       ai_canonname dq ?
       ai_addr dq ?
       ai_blob dq ?
       ai_bloblen dq ?
       ai_provider dq ?
       ai_next dq ?
ends

struct ADDRINFOEXW
       ai_flags dd ?
       ai_family dd ?
       ai_socktype dd ?
       ai_protocol dd ?
       ai_addrlen dq ?
       ai_canonname dq ?
       ai_addr dq ?
       ai_blob dq ?
       ai_bloblen dq ?
       ai_provider dq ?
       ai_next dq ?
ends

AI_PASSIVE = 1
AI_CANONNAME = 2
AI_NUMERICHOST = 4
AI_NUMERICSERV = 8
AI_ALL = $100
AI_ADDRCONFIG = $400
AI_V4MAPPED = $800

AI_NON_AUTHORITATIVE = LUP_NON_AUTHORITATIVE
AI_SECURE = LUP_SECURE
AI_RETURN_PREFERRED_NAMES = LUP_RETURN_PREFERRED_NAMES


GAI_STRERROR_BUFFER_SIZE = 1024

NI_MAXHOST = 1025
NI_MAXSERV = 32
NI_NOFQDN = 1
NI_NUMERICHOST = 2
NI_NAMEREQD = 4
NI_NUMERICSERV = 8
NI_DGRAM = $10

QOSTrafficTypeBestEffort = 0
QOSTrafficTypeBackground = 1
QOSTrafficTypeExcellentEffort = 2
QOSTrafficTypeAudioVideo = 3
QOSTrafficTypeVoice = 4
QOSTrafficTypeControl = 5

QOSSetTrafficType = 0
QOSSetOutgoingRate = 1

struct QOSPACKETPRIORITY
       ConformantDSCPValue dd ?
       NonConformantDSCPValue dd ?
       ConformantL2Value dd ?
       NonConformantL2Value dd ?
ends

struct QOSFLOWFUNDAMENTALS
       BottleneckBandwidthSet dd ?,?
       BottleneckBandwidth dq ?
       AvailableBandwidthSet dd ?,?
       AvailableBandwidth dq ?
       RTTSet dd ?
       RTT dd ?
ends

QOSFlowRateNotApplicable = 0
QOSFlowRateContentChange = 1
QOSFlowRateCongestion = 2
QOSFlowRateHigherContentEncoding = 3
QOSFlowRateUserCaused = 4

QOSShapeOnly = 0
QOSShapeAndMark = 1
QOSUseNonConformantMarkings = 2

QOS_OUTGOING_DEFAULT_MINIMUM_BANDWIDTH = $FFFFFFFF

struct QOSFLOWRATEOUTGOING
       Bandwidth dq ?
       ShapingBehavior dd ?
       Reason dd ?
ends

QOSQueryFlowFundamentals = 0
QOSQueryPacketPriority = 1
QOSQueryOutgoingRate = 2

QOSNotifyCongested = 0
QOSNotifyUncongested = 1
QOSNotifyAvailable = 2

struct QOSVERSION
       MajorVersion dw ?
       MinorVersion dw ?
ends

QOS_QUERYFLOW_FRESH = 1
QOS_NON_ADAPTIVE_FLOW = 2

;Copyright (c) 2000-2001  Microsoft Corporation
;Module Name:  nldef.h
;Abstract: This module contains basic network layer definitions.
;          Previously some of these were duplicated in both routprot.h and
;          iprtrmib.h.
;Author:
;Environment:  user mode or kernel mode

NL_MAX_METRIC_COMPONENT = ((1 shl 31) - 1)

IpPrefixOriginOther = 0
IpPrefixOriginManual = 1
IpPrefixOriginWellKnown = 2
IpPrefixOriginDhcp = 3
IpPrefixOriginRouterAdvertisement = 4
IpPrefixOriginUnchanged = (1 shl 4)

NlpoOther = IpPrefixOriginOther
NlpoManual = IpPrefixOriginManual
NlpoWellKnown = IpPrefixOriginWellKnown
NlpoDhcp = IpPrefixOriginDhcp
NlpoRouterAdvertisement = IpPrefixOriginRouterAdvertisement

NlsoOther = 0
NlsoManual = 1
NlsoWellKnown = 2
NlsoDhcp = 3
NlsoLinkLayerAddress = 4
NlsoRandom = 5

IpSuffixOriginOther = 0
IpSuffixOriginManual = 1
IpSuffixOriginWellKnown = 2
IpSuffixOriginDhcp = 3
IpSuffixOriginLinkLayerAddress = 4
IpSuffixOriginRandom = 5
IpSuffixOriginUnchanged = (1 shl 4)

NldsInvalid = 0
NldsTentative = 1
NldsDuplicate = 2
NldsDeprecated = 3
NldsPreferred = 4
IpDadStateInvalid = 0
IpDadStateTentative = 1
IpDadStateDuplicate = 2
IpDadStateDeprecated = 3
IpDadStatePreferred = 4

RouteProtocolOther = 1
RouteProtocolLocal = 2
RouteProtocolNetMgmt = 3
RouteProtocolIcmp = 4
RouteProtocolEgp = 5
RouteProtocolGgp = 6
RouteProtocolHello = 7
RouteProtocolRip = 8
RouteProtocolIsIs = 9
RouteProtocolEsIs = 10
RouteProtocolCisco = 11
RouteProtocolBbn = 12
RouteProtocolOspf = 13
RouteProtocolBgp = 14

MIB_IPPROTO_OTHER = 1
MIB_IPPROTO_LOCAL = 2
MIB_IPPROTO_NETMGMT = 3
MIB_IPPROTO_ICMP = 4
MIB_IPPROTO_EGP = 5
MIB_IPPROTO_GGP = 6
MIB_IPPROTO_HELLO = 7
MIB_IPPROTO_RIP = 8
MIB_IPPROTO_IS_IS = 9
MIB_IPPROTO_ES_IS = 10
MIB_IPPROTO_CISCO = 11
MIB_IPPROTO_BBN = 12
MIB_IPPROTO_OSPF = 13
MIB_IPPROTO_BGP = 14
MIB_IPPROTO_NT_AUTOSTATIC = 10002
MIB_IPPROTO_NT_STATIC = 10006
MIB_IPPROTO_NT_STATIC_NON_DOD = 10007

NlatUnspecified = 0
NlatUnicast = 1
NlatAnycast = 2
NlatMulticast = 3
NlatBroadcast = 4
NlatInvalid = 5

NlroManual = 0
NlroWellKnown = 1
NlroDHCP = 2
NlroRouterAdvertisement = 3
Nlro6to4 = 4

NlnsUnreachable = 0
NlnsIncomplete = 1
NlnsProbe = 2
NlnsDelay = 3
NlnsStale = 4
NlnsReachable = 5
NlnsPermanent = 6
NlnsMaximum = 7

LinkLocalAlwaysOff = 0
LinkLocalDelayed = 1
LinkLocalAlwaysOn = 2
LinkLocalUnchanged = -1

struct NLINTERFACEOFFLOADROD
       NlChecksumSupported = (1 shl 0)
       NlOptionsSupported = (1 shl 1)
       TlDatagramChecksumSupported = (1 shl 2)
       TlStreamChecksumSupported = (1 shl 3)
       TlStreamOptionsSupported = (1 shl 4)
       FastPathCompatible = (1 shl 5)
       TlLargeSendOffloadSupported = (1 shl 6)
       TlGiantSendOffloadSupported = (1 shl 7)
       bits db ?
ends

RouterDiscoveryDisabled = 0
RouterDiscoveryEnabled = 1
RouterDiscoveryDhcp = 2
RouterDiscoveryUnchanged = -1

NlbwDisabled = 0
NlbwEnabled = 1
NlbwUnchanged = -1

struct NLPATHBANDWIDTHROD
       Bandwidth dq ?
       Instability dq ?
       BandwidthPeaked dd ?,?
ends

;Copyright (c) Microsoft Corporation. All rights reserved.
;Module Name:  mstcpip.h
;This module contains Microsoft-specific extensions to the core
;Winsock definitions.
;Environment:
;user mode or kernel mode

struct TCPKEEPALIVE
       onoff dd ?
       keepalivetime dd ?
       keepaliveinterval dd ?
ends

SIO_RCVALL = $98000001
SIO_RCVALL_MCAST = $98000002
SIO_RCVALL_IGMPMCAST = $98000003
SIO_KEEPALIVE_VALS = $98000004
SIO_ABSORB_RTRALERT = $98000005
SIO_UCAST_IF = $98000006
SIO_LIMIT_BROADCASTS = $98000007
SIO_INDEX_BIND = $98000008
SIO_INDEX_MCASTIF = $98000009
SIO_INDEX_ADD_MCAST = $9800000a
SIO_INDEX_DEL_MCAST = $9800000b
SIO_RCVALL_MCAST_IF = $9800000c
SIO_RCVALL_IF = $9800000d

RCVALL_OFF = 0
RCVALL_ON = 1
RCVALL_SOCKETLEVELONLY = 2
RCVALL_IPLEVEL = 3
RCVALL_MAX = RCVALL_IPLEVEL

struct RCVALLIF
       Mode dd ?
       Interface dd ?
ends

SIO_ACQUIRE_PORT_RESERVATION = $98000064
SIO_RELEASE_PORT_RESERVATION = $98000065
SIO_ASSOCIATE_PORT_RESERVATION = $98000066

struct INETPORTRANGE
       StartPort dw ?
       NumberOfPorts dw ?
ends

struct INETPORTRESERVATIONTOKEN
       Token dq ?
ends

INVALID_PORT_RESERVATION_TOKEN = 0

struct INETPORTRESERVATIONINSTANCE
       Reservation dd ?,?
       Token INETPORTRESERVATIONTOKEN
ends

struct INETPORTRESERVATIONINFORMATION
       AssignmentCount dd ?
       OwningPid dd ?
ends

SIO_SET_SECURITY = $980000c8
SIO_QUERY_SECURITY = $980000c9
SIO_SET_PEER_TARGET_NAME = $980000ca
SIO_DELETE_PEER_TARGET_NAME = $980000cb
SIO_SOCKET_USAGE_NOTIFICATION = $980000cc

SYSTEM_CRITICAL_SOCKET = 1

SOCKET_SECURITY_PROTOCOL_DEFAULT = 0
SOCKET_SECURITY_PROTOCOL_IPSEC = 1
SOCKET_SECURITY_PROTOCOL_INVALID = 2

SOCKET_SETTINGS_GUARANTEE_ENCRYPTION = 1
SOCKET_SETTINGS_ALLOW_INSECURE = 2

struct SOCKETSECURITYSETTINGS
       SecurityProtocol dd ?
       SecurityFlags dd ?
ends

SOCKET_SETTINGS_IPSEC_SKIP_FILTER_INSTANTIATION = 1

struct SOCKETSECURITYSETTINGSIPSEC
       SecurityProtocol dd ?
       SecurityFlags dd ?
       IpsecFlags dd ?,?
       AuthipMMPolicyKey GUID
       AuthipQMPolicyKey GUID
       Reserved GUID
       Reserved2 dq ?
       UserNameStringLen dd ?
       DomainNameStringLen dd ?
       PasswordStringLen dd ?
       AllStrings dd ?
ends

struct SOCKETPEERTARGETNAME
       SecurityProtocol dd ?,?
       PeerAddress SOCKADDRSTORAGE
       PeerTargetNameStringLen dd ?
       AllStrings dd ?
ends

struct SOCKETSECURITYQUERYTEMPLATE
       SecurityProtocol dd ?,?
       PeerAddress SOCKADDRSTORAGE
       PeerTokenAccessMask dd ?,?
ends

SOCKET_INFO_CONNECTION_SECURED = 1
SOCKET_INFO_CONNECTION_ENCRYPTED = 2

struct SOCKETSECURITYQUERYINFO
       SecurityProtocol dd ?
       Flags dd ?
       PeerApplicationAccessTokenHandle dq ?
       PeerMachineAccessTokenHandle dq ?
ends

SIO_QUERY_WFP_ALE_ENDPOINT_HANDLE = $580000CD
SIO_QUERY_RSS_SCALABILITY_INFO = $580000D2

struct RSSSCALABILITYINFO
       RssEnabled db ?
ends

IN4ADDR_ANY = INADDR_ANY
IN4ADDR_LOOPBACK = $100007f
IN4ADDR_BROADCAST = INADDR_BROADCAST
IN4ADDR_NONE = INADDR_NONE
IN4ADDR_ANY_INIT = 0
IN4ADDR_LOOPBACK_INIT equ $7f, 0, 0, 1
IN4ADDR_BROADCAST_INIT equ $ff, $ff, $ff, $ff
IN4ADDR_ALLNODESONLINK_INIT equ $e0, 0, 0, 1
IN4ADDR_ALLROUTERSONLINK_INIT equ $e0, 0, 0, 2
IN4ADDR_ALLIGMPV3ROUTERSONLINK_INIT equ $e0, 0, 0, 16
IN4ADDR_ALLTEREDONODESONLINK_INIT equ $e0, 0, 0, $fd
IN4ADDR_LINKLOCALPREFIX_INIT equ $a9, $fe,
IN4ADDR_MULTICASTPREFIX_INIT equ $e0,

IN4ADDR_LOOPBACKPREFIX_LENGTH = 8
IN4ADDR_LINKLOCALPREFIX_LENGTH = 16
IN4ADDR_MULTICASTPREFIX_LENGTH = 4

QOSFlowRateNotApplicable = 0
QOSFlowRateContentChange = 1
QOSFlowRateCongestion = 2
QOSFlowRateHigherContentEncoding = 3
QOSFlowRateUserCaused = 4

QOSShapeOnly = 0
QOSShapeAndMark = 1
QOSUseNonConformantMarkings = 2

QOS_OUTGOING_DEFAULT_MINIMUM_BANDWIDTH = $FFFFFFFF

QOSQueryFlowFundamentals    = 0
QOSQueryPacketPriority	    = 1
QOSQueryOutgoingRate	    = 2

QOSNotifyCongested	    = 0
QOSNotifyUncongested	    = 1
QOSNotifyAvailable	    = 2

QOS_QUERYFLOW_FRESH = 1
QOS_NON_ADAPTIVE_FLOW = 2

struct QOS
       SendingFlowspec FLOWSPEC
       ReceivingFlowspec FLOWSPEC
       ProviderSpecific WSABUF
ends

CF_ACCEPT = 0
CF_REJECT = 1
CF_DEFER = 2

SD_RECEIVE = 0
SD_SEND = 1
SD_BOTH = 2

SG_UNCONSTRAINED_GROUP = 1
SG_CONSTRAINED_GROUP = 2

struct WSANETWORKEVENTS
       lNetworkEvents dd ?
       iErrorCode dd FD_MAX_EVENTS dup(?)
ends

MAX_PROTOCOL_CHAIN = 7
BASE_PROTOCOL = 1
LAYERED_PROTOCOL = 0

struct WSAPROTOCOLCHAIN
       ChainLen dd ?
       ChainEntries dd MAX_PROTOCOL_CHAIN dup(?)
ends

WSAPROTOCOL_LEN = 255

struct WSAPROTOCOLINFOA
       dwServiceFlags1 dd ?
       dwServiceFlags2 dd ?
       dwServiceFlags3 dd ?
       dwServiceFlags4 dd ?
       dwProviderFlags dd ?
       ProviderId GUID
       dwCatalogEntryId dd ?
       ProtocolChain WSAPROTOCOLCHAIN
       iVersion dd ?
       iAddressFamily dd ?
       iMaxSockAddr dd ?
       iMinSockAddr dd ?
       iSocketType dd ?
       iProtocol dd ?
       iProtocolMaxOffset dd ?
       iNetworkByteOrder dd ?
       iSecurityScheme dd ?
       dwMessageSize dd ?
       dwProviderReserved dd ?
       szProtocol db WSAPROTOCOL_LEN+1 dup(?)
ends

struct WSAPROTOCOLINFOW
       dwServiceFlags1 dd ?
       dwServiceFlags2 dd ?
       dwServiceFlags3 dd ?
       dwServiceFlags4 dd ?
       dwProviderFlags dd ?
       ProviderId GUID
       dwCatalogEntryId dd ?
       ProtocolChain WSAPROTOCOLCHAIN
       iVersion dd ?
       iAddressFamily dd ?
       iMaxSockAddr dd ?
       iMinSockAddr dd ?
       iSocketType dd ?
       iProtocol dd ?
       iProtocolMaxOffset dd ?
       iNetworkByteOrder dd ?
       iSecurityScheme dd ?
       dwMessageSize dd ?
       dwProviderReserved dd ?
       szProtocol du WSAPROTOCOL_LEN+1 dup(?)
ends

PFL_MULTIPLE_PROTO_ENTRIES = 1
PFL_RECOMMENDED_PROTO_ENTRY = 2
PFL_HIDDEN = 4
PFL_MATCHES_PROTOCOL_ZERO = 8

XP1_CONNECTIONLESS = 1
XP1_GUARANTEED_DELIVERY = 2
XP1_GUARANTEED_ORDER = 4
XP1_MESSAGE_ORIENTED = 8
XP1_PSEUDO_STREAM = $10
XP1_GRACEFUL_CLOSE = $20
XP1_EXPEDITED_DATA = $40
XP1_CONNECT_DATA = $80
XP1_DISCONNECT_DATA = $100
XP1_SUPPORT_BROADCAST = $200
XP1_SUPPORT_MULTIPOINT = $400
XP1_MULTIPOINT_CONTROL_PLANE = $800
XP1_MULTIPOINT_DATA_PLANE = $1000
XP1_QOS_SUPPORTED = $2000
XP1_INTERRUPT = $4000
XP1_UNI_SEND = $8000
XP1_UNI_RECV = $10000
XP1_IFS_HANDLES = $20000
XP1_PARTIAL_MESSAGE = $40000
XP1_SAN_SUPPORT_SDP = $80000

BIGENDIAN = 0
LITTLEENDIAN = 1
SECURITY_PROTOCOL_NONE = 0

JL_SENDER_ONLY = 1
JL_RECEIVER_ONLY = 2
JL_BOTH = 4

WSA_FLAG_OVERLAPPED = 1
WSA_FLAG_MULTIPOINT_C_ROOT = 2
WSA_FLAG_MULTIPOINT_C_LEAF = 4
WSA_FLAG_MULTIPOINT_D_ROOT = 8
WSA_FLAG_MULTIPOINT_D_LEAF = $10
WSA_FLAG_ACCESS_SYSTEM_SECURITY = $40

SIO_NSP_NOTIFY_CHANGE = $88000019

NSP_NOTIFY_IMMEDIATELY = 0
NSP_NOTIFY_HWND = 1
NSP_NOTIFY_EVENT = 2
NSP_NOTIFY_PORT = 3
NSP_NOTIFY_APC = 4

struct WSACOMPLETION ;lpOverlapped might give you problems
       Type dd ?,?
       union
	   struct
	       hWnd dq ?
	       uMsg dd ?
	       context dq ?
	   ends
	   struct
	       lpOverlapped0 dq ?
	   ends
	   struct
	       lpOverlapped1 dq ?
	       lpfnCompletionProc dq ?
	   ends
	   struct
	       lpOverlapped2 dq ?
	       hPort dq ?
	       Key dq ?
	   ends
       ends
ends

TH_NETDEV = 1
TH_TAPI = 2

SERVICE_MULTIPLE = 1

NS_ALL = 0
NS_SAP = 1
NS_NDS = 2
NS_PEER_BROWSE = 3
NS_SLP = 5
NS_DHCP = 6
NS_TCPIP_LOCAL = 10
NS_TCPIP_HOSTS = 11
NS_DNS = 12
NS_NETBT = 13
NS_WINS = 14
NS_NLA = 15
NS_BTH = 16
NS_NBP = 20
NS_MS = 30
NS_STDA = 31
NS_NTDS = 32
NS_EMAIL = 37
NS_PNRPNAME = 38
NS_PNRPCLOUD = 39
NS_X500 = 40
NS_NIS = 41
NS_NISPLUS = 42
NS_WRQ = 50
NS_NETDES = 60

RES_UNUSED_1 = 1
RES_FLUSH_CACHE = 2
RES_SERVICE = 4

SERVICE_TYPE_VALUE_IPXPORTA equ "IpxSocket"
SERVICE_TYPE_VALUE_IPXPORTW equ "IpxSocket"
SERVICE_TYPE_VALUE_SAPIDA equ "SapId"
SERVICE_TYPE_VALUE_SAPIDW equ "SapId"
SERVICE_TYPE_VALUE_TCPPORTA equ "TcpPort"
SERVICE_TYPE_VALUE_TCPPORTW equ "TcpPort"
SERVICE_TYPE_VALUE_UDPPORTA equ "UdpPort"
SERVICE_TYPE_VALUE_UDPPORTW equ "UdpPort"
SERVICE_TYPE_VALUE_OBJECTIDA equ "ObjectId"
SERVICE_TYPE_VALUE_OBJECTIDW equ "ObjectId"

struct AFPROTOCOLS
       iAddressFamily dd ?
       iProtocol dd ?
ends

COMP_EQUAL = 0
COMP_NOTLESS = 1

struct WSAVERSION
       dwVersion dd ?
       ecHow dd ?
ends

struct WSAQUERYSETA
       dwSize dd ?,?
       lpszServiceInstanceName dq ?
       lpServiceClassId dq ?
       lpVersion dq ?
       lpszComment dq ?
       dwNameSpace dd ?,?
       lpNSProviderId dq ?
       lpszContext dq ?
       dwNumberOfProtocols dd ?,?
       lpafpProtocols dq ?
       lpszQueryString dq ?
       dwNumberOfCsAddrs dd ?,?
       lpcsaBuffer dq ?
       dwOutputFlags dd ?,?
       lpBlob dq ?
ends

struct WSAQUERYSETW
       dwSize dd ?,?
       lpszServiceInstanceName dq ?
       lpServiceClassId dq ?
       lpVersion dq ?
       lpszComment dq ?
       dwNameSpace dd ?,?
       lpNSProviderId dq ?
       lpszContext dq ?
       dwNumberOfProtocols dd ?,?
       lpafpProtocols dq ?
       lpszQueryString dq ?
       dwNumberOfCsAddrs dd ?,?
       lpcsaBuffer dq ?
       dwOutputFlags dd ?,?
       lpBlob dq ?
ends

struct WSAQUERYSET2A
       dwSize dd ?,?
       lpszServiceInstanceName dq ?
       lpVersion dq ?
       lpszComment dq ?
       dwNameSpace dd ?,?
       lpNSProviderId dq ?
       lpszContext dq ?
       dwNumberOfProtocols dd ?,?
       lpafpProtocols dq ?
       lpszQueryString dq ?
       dwNumberOfCsAddrs dd ?,?
       lpcsaBuffer dq ?
       dwOutputFlags dd ?,?
       lpBlob dq ?
ends

struct WSAQUERYSET2W
       dwSize dd ?,?
       lpszServiceInstanceName dq ?
       lpVersion dq ?
       lpszComment dq ?
       dwNameSpace dd ?,?
       lpNSProviderId dq ?
       lpszContext dq ?
       dwNumberOfProtocols dd ?,?
       lpafpProtocols dq ?
       lpszQueryString dq ?
       dwNumberOfCsAddrs dd ?,?
       lpcsaBuffer dq ?
       dwOutputFlags dd ?,?
       lpBlob dq ?
ends

LUP_DEEP = 1
LUP_CONTAINERS = 2
LUP_NOCONTAINERS = 4
LUP_NEAREST = 8
LUP_RETURN_NAME = $10
LUP_RETURN_TYPE = $20
LUP_RETURN_VERSION = $40
LUP_RETURN_COMMENT = $80
LUP_RETURN_ADDR = $100
LUP_RETURN_BLOB = $200
LUP_RETURN_ALIASES = $400
LUP_RETURN_QUERY_STRING = $800
LUP_RETURN_ALL = $FF0
LUP_RES_SERVICE = $8000
LUP_FLUSHCACHE = $1000
LUP_FLUSHPREVIOUS = $2000
LUP_NON_AUTHORITATIVE = $4000
LUP_SECURE = $8000
LUP_RETURN_PREFERRED_NAMES = $10000
LUP_ADDRCONFIG = $100000
LUP_DUAL_ADDR = $200000

RESULT_IS_ALIAS = 1
RESULT_IS_ADDED = $10
RESULT_IS_CHANGED = $20
RESULT_IS_DELETED = $40

RNRSERVICE_REGISTER = 0
RNRSERVICE_DEREGISTER = 1
RNRSERVICE_DELETE = 2

struct WSANSCLASSINFOA
       lpszName dq ?
       dwNameSpace dd ?
       dwValueType dd ?
       dwValueSize dd ?,?
       lpValue dq ?
ends

struct WSANSCLASSINFOW
       lpszName dq ?
       dwNameSpace dd ?
       dwValueType dd ?
       dwValueSize dd ?,?
       lpValue dq ?
ends

struct WSASERVICECLASSINFOA
       lpServiceClassId dq ?
       lpszServiceClassName dq ?
       dwCount dd ?,?
       lpClassInfos dq ?
ends

struct WSASERVICECLASSINFOW
       lpServiceClassId dq ?
       lpszServiceClassName dq ?
       dwCount dd ?,?
       lpClassInfos dq ?
ends

struct WSANAMESPACEINFOA
       NSProviderId GUID
       dwNameSpace dd ?
       fActive dd ?
       dwVersion dd ?,?
       lpszIdentifier dq ?
ends

struct WSANAMESPACEINFOW
       NSProviderId GUID
       dwNameSpace dd ?
       fActive dd ?
       dwVersion dd ?,?
       lpszIdentifier dq ?
ends

struct WSANAMESPACEINFOEXA
       NSProviderId GUID
       dwNameSpace dd ?
       fActive dd ?
       dwVersion dd ?,?
       lpszIdentifier dq ?
       ProviderSpecific BLOB
ends

struct WSANAMESPACEINFOEXW
       NSProviderId GUID
       dwNameSpace dd ?
       fActive dd ?
       dwVersion dd ?,?
       lpszIdentifier dq ?
       ProviderSpecific BLOB
ends

POLLRDNORM = $100
POLLRDBAND = $200
POLLIN = (POLLRDNORM or POLLRDBAND)
POLLPRI = $400
POLLWRNORM = $10
POLLOUT = POLLWRNORM
POLLWRBAND = $20
POLLERR = 1
POLLHUP = 2
POLLNVAL = 4

struct WSAPOLLFD
       fd dq ?
       events dw ?
       revents dw ?,?,?
ends

;$IPCategory:
;$DealPointID:    118736
;$AgreementName:  berkeley software distribution license
;$AgreementType:  oss license
;$ExternalOrigin: regents of the university of california
;$Owner:          vadime
;$Module:         published_inc

;WS2SPI.H -- definitions to be used with the WinSock service provider.
;
;Copyright (c) Microsoft Corporation. All rights reserved.
;
;This header file corresponds to version 2.2.x of the WinSock SPI
;specification.
;
;This file includes parts which are Copyright (c) 1982-1986 Regents
;of the University of California.  All rights reserved.  The
;Berkeley Software License Agreement specifies the terms and
;conditions for redistribution.

WSPDESCRIPTION_LEN = 255
WSS_OPERATION_IN_PROGRESS = $103

struct WSPDATA
       wVersion dw ?
       wHighVersion dw ?
       szDescription du WSPDESCRIPTION_LEN+1 dup(?)
ends

struct WSATHREADID
       ThreadHandle dq ?
       Reserved dq ?
ends

struct WSPPROCTABLE
       lpWSPAccept dq ?
       lpWSPAddressToString dq ?
       lpWSPAsyncSelect dq ?
       lpWSPBind dq ?
       lpWSPCancelBlockingCall dq ?
       lpWSPCleanup dq ?
       lpWSPCloseSocket dq ?
       lpWSPConnect dq ?
       lpWSPDuplicateSocket dq ?
       lpWSPEnumNetworkEvents dq ?
       lpWSPEventSelect dq ?
       lpWSPGetOverlappedResult dq ?
       lpWSPGetPeerName dq ?
       lpWSPGetSockName dq ?
       lpWSPGetSockOpt dq ?
       lpWSPGetQOSByName dq ?
       lpWSPIoctl dq ?
       lpWSPJoinLeaf dq ?
       lpWSPListen dq ?
       lpWSPRecv dq ?
       lpWSPRecvDisconnect dq ?
       lpWSPRecvFrom dq ?
       lpWSPSelect dq ?
       lpWSPSend dq ?
       lpWSPSendDisconnect dq ?
       lpWSPSendTo dq ?
       lpWSPSetSockOpt dq ?
       lpWSPShutdown dq ?
       lpWSPSocket dq ?
       lpWSPStringToAddress dq ?
ends

struct WSPUPCALLTABLE
       lpWPUCloseEvent dq ?
       lpWPUCloseSocketHandle dq ?
       lpWPUCreateEvent dq ?
       lpWPUCreateSocketHandle dq ?
       lpWPUFDIsSet dq ?
       lpWPUGetProviderPath dq ?
       lpWPUModifyIFSHandle dq ?
       lpWPUPostMessage dq ?
       lpWPUQueryBlockingCallback dq ?
       lpWPUQuerySocketHandleContext dq ?
       lpWPUQueueApc dq ?
       lpWPUResetEvent dq ?
       lpWPUSetEvent dq ?
       lpWPUOpenCurrentThread dq ?
       lpWPUCloseThread dq ?
ends

LSP_SYSTEM = 0
LSP_INSPECTOR = 1
LSP_REDIRECTOR = 2
LSP_PROXY = 4
LSP_FIREWALL = 8
LSP_INBOUND_MODIFY = $10
LSP_OUTBOUND_MODIFY = $20
LSP_CRYPTO_COMPRESS = $40
LSP_LOCAL_CACHE = $80

ProviderInfoLspCategories = 0
ProviderInfoAudit = 1

struct WSCPROVIDERAUDITINFO
       RecordSize dd ?,?
       Reserved dq ?
ends

struct NSPROUTINE
       cbSize dd ?
       dwMajorVersion dd ?
       dwMinorVersion dd ?,?
       NSPCleanup dq ?
       NSPLookupServiceBegin dq ?
       NSPLookupServiceNext dq ?
       NSPLookupServiceEnd dq ?
       NSPSetService dq ?
       NSPInstallServiceClass dq ?
       NSPRemoveServiceClass dq ?
       NSPGetServiceClassInfo dq ?
       NSPIoctl dq ?
ends

struct NSPV2ROUTINE
       cbSize dd ?
       dwMajorVersion dd ?
       dwMinorVersion dd ?,?
       NSPv2Startup dq ?
       NSPv2Cleanup dq ?
       NSPv2LookupServiceBegin dq ?
       NSPv2LookupServiceNextEx dq ?
       NSPv2LookupServiceEnd dq ?
       NSPv2SetServiceEx dq ?
       NSPv2ClientSessionRundown dq ?
ends

;Module Name:  ws2ipdef.h
;
;Abstract:
;    This file contains TCP/IP specific information for use
;    by WinSock2 compatible applications.
;
;    Copyright (c) Microsoft Corporation. All rights reserved.
;
;    To provide the backward compatibility, all the TCP/IP
;    specific definitions that were included in the WINSOCK.H
;    file are now included in WINSOCK2.H file. WS2TCPIP.H
;    file includes only the definitions  introduced in the
;    "WinSock 2 Protocol-Specific Annex" document.
;
;    Rev 0.3 Nov 13, 1995
;        Rev 0.4 Dec 15, 1996
;
;Environment:
;
;    user mode or kernel mode


;Copyright (c) Microsoft Corporation
;Module Name:  in6addr.h
;Environment:  user mode or kernel mode
struct INADDR6
       union
	   Byte db 16 dup(?)
	   Word dw 8 dup(?)
       ends
ends

;Old IPv6 socket address structure (retained for sockaddr_gen definition).
struct SOCKADDRIN6OLD
       sin6_family dw ?
       sin6_port dw ?
       sin6_flowinfo dd ?
       sin6_addr INADDR6
ends

struct SOCKADDRGEN
       union
	   Address SOCKADDR
	   AddressIn SOCKADDRIN
	   AddressIn6 SOCKADDRIN6OLD
       ends
ends

struct INTERFACEINFO
       iiFlags dd ?
       iiAddress SOCKADDRGEN
       iiBroadcastAddress SOCKADDRGEN
       iiNetmask SOCKADDRGEN
ends

struct INTERFACEINFOEX
       iiFlags dd ?
       iiAddress SOCKETADDRESS
       iiBroadcastAddress SOCKETADDRESS
       iiNetmask SOCKETADDRESS
ends

IFF_UP	= 1
IFF_BROADCAST = 2
IFF_LOOPBACK = 4
IFF_POINTTOPOINT = 8
IFF_MULTICAST = $10

IP_OPTIONS = 1
IP_HDRINCL = 2
IP_TOS = 3
IP_TTL = 4
IP_MULTICAST_IF = 9
IP_MULTICAST_TTL = 10
IP_MULTICAST_LOOP = 11
IP_ADD_MEMBERSHIP = 12
IP_DROP_MEMBERSHIP = 13
IP_DONTFRAGMENT = 14
IP_ADD_SOURCE_MEMBERSHIP = 15
IP_DROP_SOURCE_MEMBERSHIP = 16
IP_BLOCK_SOURCE = 17
IP_UNBLOCK_SOURCE = 18
IP_PKTINFO = 19
IP_HOPLIMIT = 21
IP_RECEIVE_BROADCAST = 22
IP_RECVIF = 24
IP_RECVDSTADDR = 25
IP_IFLIST = 28
IP_ADD_IFLIST = 29
IP_DEL_IFLIST = 30
IP_UNICAST_IF = 31
IP_RTHDR = 32
IP_RECVRTHDR = 38
IP_UNSPECIFIED_TYPE_OF_SERVICE = -1

struct SOCKADDRIN6LH
       sin6_family dw ?
       sin6_port dw ?
       sin6_flowinfo dd ?
       sin6_addr INADDR6
       union
	   sin6_scope_id dd ?
	   sin6_scope_struct dd ? ;SCOPE_ID sin6_scope_struct
       ends
ends

struct SOCKADDRIN6W2KSP1
       sin6_family dw ?
       sin6_port dw ?
       sin6_flowinfo dd ?
       sin6_addr INADDR6
       sin6_scope_id dd ?
ends

struct SOCKADDRINET
       union
	   Ipv4 SOCKADDRIN
	   Ipv6 SOCKADDRIN6LH
	   si_family dw ?
       ends
ends

struct SOCKADDRIN6PAIR
       SourceAddress dq ?
       DestinationAddress dq ?
ends

;#define SS_PORT(ssp) (((PSOCKADDR_IN)(ssp))->sin_port)
IN6ADDR_ANY_INIT = 0

IN6ADDR_LOOPBACK_INIT equ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
IN6ADDR_ALLNODESONNODE_INIT equ $ff, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
IN6ADDR_ALLNODESONLINK_INIT equ $ff, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
IN6ADDR_ALLROUTERSONLINK_INIT equ $ff, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
IN6ADDR_ALLMLDV2ROUTERSONLINK_INIT equ $ff, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $16 \
IN6ADDR_TEREDOINITIALLINKLOCALADDRESS_INIT equ $fe, $80, 0, 0, 0, 0, 0, 0, 0, 0, $ff,\
					       $ff, $ff, $ff, $ff, $fe,
IN6ADDR_LINKLOCALPREFIX_INIT equ $fe, $80,
IN6ADDR_MULTICASTPREFIX_INIT equ $ff, 0,
IN6ADDR_SOLICITEDNODEMULTICASTPREFIX_INIT equ $ff, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, $ff,
IN6ADDR_V4MAPPEDPREFIX_INIT equ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $ff, $ff,
IN6ADDR_6TO4PREFIX_INIT equ $20, 2,
IN6ADDR_TEREDOPREFIX_INIT equ $20, 1, 0, 0,
IN6ADDR_LINKLOCALPREFIX_LENGTH equ 64
IN6ADDR_MULTICASTPREFIX_LENGTH equ 8
IN6ADDR_SOLICITEDNODEMULTICASTPREFIX_LENGTH equ 104
IN6ADDR_V4MAPPEDPREFIX_LENGTH equ 96
IN6ADDR_6TO4PREFIX_LENGTH equ 16
IN6ADDR_TEREDOPREFIX_LENGTH equ 32

SIO_GET_INTERFACE_LIST = $4004747f
SIO_GET_INTERFACE_LIST_EX = $4004747e
SIO_SET_MULTICAST_FILTER = $8004747d
SIO_GET_MULTICAST_FILTER = $8004747c
SIOCSIPMSFILTER = SIO_SET_MULTICAST_FILTER
SIOCGIPMSFILTER = SIO_GET_MULTICAST_FILTER
SIOCSMSFILTER = $8004747e
SIOCGMSFILTER = $8004747f

SIO_IDEAL_SEND_BACKLOG_QUERY = $4004747b
SIO_IDEAL_SEND_BACKLOG_CHANGE = $2000747a

MCAST_JOIN_GROUP = 41
MCAST_LEAVE_GROUP = 42
MCAST_BLOCK_SOURCE = 43
MCAST_UNBLOCK_SOURCE = 44
MCAST_JOIN_SOURCE_GROUP = 45
MCAST_LEAVE_SOURCE_GROUP = 46

MCAST_INCLUDE = 0
MCAST_EXCLUDE = 1

struct IPMREQSOURCE
       imr_multiaddr dd ?
       imr_sourceaddr dd ?
       imr_interface dd ?
ends

struct IPMSFILTER
       imsf_multiaddr dd ?
       imsf_interface dd ?
       imsf_fmode dd ?
       imsf_numsrc dd ?
       imsf_slist dd ?
ends

;#define IP_MSFILTER_SIZE(NumSources) \
;    (sizeof(IP_MSFILTER) - sizeof(IN_ADDR) + (NumSources) * sizeof(IN_ADDR))

IPV6_HOPOPTS = 1
IPV6_HDRINCL = 2
IPV6_UNICAST_HOPS = 4
IPV6_MULTICAST_IF = 9
IPV6_MULTICAST_HOPS = 10
IPV6_MULTICAST_LOOP = 11
IPV6_ADD_MEMBERSHIP = 12
IPV6_JOIN_GROUP = IPV6_ADD_MEMBERSHIP
IPV6_DROP_MEMBERSHIP = 13
IPV6_LEAVE_GROUP = IPV6_DROP_MEMBERSHIP
IPV6_DONTFRAG = 14
IPV6_PKTINFO = 19
IPV6_HOPLIMIT = 21
IPV6_PROTECTION_LEVEL = 23
IPV6_RECVIF = 24
IPV6_RECVDSTADDR = 25
IPV6_CHECKSUM = 26
IPV6_V6ONLY = 27
IPV6_IFLIST = 28
IPV6_ADD_IFLIST = 29
IPV6_DEL_IFLIST = 30
IPV6_UNICAST_IF = 31
IPV6_RTHDR = 32
IPV6_RECVRTHDR = 38
IP_UNSPECIFIED_HOP_LIMIT = -1

PROTECTION_LEVEL_UNRESTRICTED = 10
PROTECTION_LEVEL_EDGERESTRICTED = 20
PROTECTION_LEVEL_RESTRICTED = 30

PROTECTION_LEVEL_DEFAULT = -1

struct IPV6MREQ
       ipv6mr_multiaddr INADDR6
       ipv6mr_interface dd ?
ends

struct GROUPREQ
       gr_interface dd ?
       gr_group SOCKADDRSTORAGE
ends

struct GROUPSOURCEREQ
       gsr_interface dd ?,?
       gsr_group SOCKADDRSTORAGE
       gsr_source SOCKADDRSTORAGE
ends

struct GROUPFILTER
       gf_interface dd ?,?
       gf_group SOCKADDRSTORAGE
       gf_fmode dd ?
       gf_numsrc dd ?
       gf_slist SOCKADDRSTORAGE
ends

struct INPKTINFO
       ipi_addr dd ?
       ipi_ifindex dd ?
ends

struct IN6PKTINFO
       ipi6_addr INADDR6
       ipi6_ifindex dd ?
ends

INET_ADDRSTRLEN = 22
INET6_ADDRSTRLEN = 65

TCP_OFFLOAD_NO_PREFERENCE = 0
TCP_OFFLOAD_NOT_PREFERRED = 1
TCP_OFFLOAD_PREFERRED = 2

TCP_EXPEDITED_1122 = 2
TCP_KEEPALIVE = 3
TCP_MAXSEG = 4
TCP_MAXRT = 5
TCP_STDURG = 6
TCP_NOURG = 7
TCP_ATMARK = 8
TCP_NOSYNRETRIES = 9
TCP_TIMESTAMPS = 10
TCP_OFFLOAD_PREFERENCE = 11
TCP_CONGESTION_ALGORITHM = 12
TCP_DELAY_FIN_ACK = 13

;Copyright (c) 2000  Microsoft Corporation
;Module Name:  ws2bth.h
;Abstract:  Winsock 2 Bluetooth Annex definitions.
;Notes:     Change BT_* to BTH_*

;Copyright (c) 2000  Microsoft Corporation
;Module Name:  bthdef.h
;Abstract: This module contains the Bluetooth common structures and definitions
;Environment: Kernel mode only
BTH_MAJORVERSION = 2
BTH_MINORVERSION = 0

struct SDPLARGEINTEGER16
       LowPart dq ?
       HighPart dq ?
ends

struct SDPULARGEINTEGER16
       LowPart dq ?
       HighPart dq ?
ends

NodeContainerTypeSequence = 0
NodeContainerTypeAlternative = 1

SDP_TYPE_NIL =	0
SDP_TYPE_UINT = 1
SDP_TYPE_INT = 2
SDP_TYPE_UUID = 3
SDP_TYPE_STRING = 4
SDP_TYPE_BOOLEAN = 5
SDP_TYPE_SEQUENCE = 6
SDP_TYPE_ALTERNATIVE = 7
SDP_TYPE_URL = 8
SDP_TYPE_CONTAINER = $20

SDP_ST_NONE = 0
SDP_ST_UINT8 = $10
SDP_ST_UINT16 = $110
SDP_ST_UINT32 = $210
SDP_ST_UINT64 = $310
SDP_ST_UINT128 = $410
SDP_ST_INT8 = $20
SDP_ST_INT16 = $120
SDP_ST_INT32 = $220
SDP_ST_INT64 = $320
SDP_ST_INT128 = $420
SDP_ST_UUID16 = $130
SDP_ST_UUID32 = $220
SDP_ST_UUID128 = $430

struct SDPATTRIBUTERANGE
       minAttribute dw ?
       maxAttribute dw ?
ends

struct SDPQUERYUUIDUNION
       union
	   uuid128 GUID
	   uuid32 dd ?
	   uuid16 dw ?
       ends
ends

struct SDPQUERYUUID
       u SDPQUERYUUIDUNION
       uuidType dw ?,?
ends

;GUID_BTHPORT_DEVICE_INTERFACE GUID $850302a,$b344,$4fda,<$9b,$e9,$90,$57,$6b,$8d,$46,$f0>
;GUID_BLUETOOTH_RADIO_IN_RANGE GUID $ea3b5b82,$26ee,$450e,<$b0,$d8,$d2,$6f,$e3,$a,$38,$69>
;GUID_BLUETOOTH_RADIO_OUT_OF_RANGE GUID $e28867c9,$c2aa,$4ced,<$b9,$69,$45,$70,$86,$60,$37,$c4>
;GUID_BLUETOOTH_PIN_REQUEST GUID $bd198b7c,$24ab,$4b9a,<$8c,$0d,$a8,$ea,$83,$49,$aa,$16>
;GUID_BLUETOOTH_L2CAP_EVENT GUID $7eae4030,$b709,$4aa8,<$ac,$55,$e9,$53,$82,$9c,$9d,$aa>
;GUID_BLUETOOTH_HCI_EVENT GUID $fc240062,$1541,$49be,<$b4,$63,$84,$c4,$dc,$d7,$bf,$7f>
;Bluetooth_Base_UUID GUID 0,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>

;SDP_PROTOCOL_UUID GUID 1,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;UDP_PROTOCOL_UUID GUID 2,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;RFCOMM_PROTOCOL_UUID GUID 3,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;TCP_PROTOCOL_UUID GUID 4,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;TCSBIN_PROTOCOL_UUID GUID 5,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;TCSAT_PROTOCOL_UUID GUID 6,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;OBEX_PROTOCOL_UUID GUID 8,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;IP_PROTOCOL_UUID GUID 9,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;FTP_PROTOCOL_UUID GUID $A,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;HTTP_PROTOCOL_UUID GUID $C,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;WSP_PROTOCOL_UUID GUID $E,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;BNEP_PROTOCOL_UUID GUID $F,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;UPNP_PROTOCOL_UUID GUID $10,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;HID_PROTOCOL_UUID GUID $11,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;HCCC_PROTOCOL_UUID GUID $12,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;HCDC_PROTOCOL_UUID GUID $14,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;HN_PROTOCOL_UUID GUID $16,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;AVCTP_PROTOCOL_UUID GUID $17,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;AVDTP_PROTOCOL_UUID GUID $19,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;CMPT_PROTOCOL_UUID GUID $1B,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;UDI_C_PLANE_PROTOCOL_UUID GUID $1D,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;L2CAP_PROTOCOL_UUID GUID $100,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>

SDP_PROTOCOL_UUID16 = 1
UDP_PROTOCOL_UUID16 = 2
RFCOMM_PROTOCOL_UUID16 = 3
TCP_PROTOCOL_UUID16 = 4
TCSBIN_PROTOCOL_UUID16 = 5
TCSAT_PROTOCOL_UUID16 = 6
OBEX_PROTOCOL_UUID16 = 8
IP_PROTOCOL_UUID16 = 9
FTP_PROTOCOL_UUID16 = $A
HTTP_PROTOCOL_UUID16 = $C
WSP_PROTOCOL_UUID16 = $E
BNEP_PROTOCOL_UUID16 = $F
UPNP_PROTOCOL_UUID16 = $10
HID_PROTOCOL_UUID16 = $11
HCCC_PROTOCOL_UUID16 = $12
HCDC_PROTOCOL_UUID16 = $14
HCN_PROTOCOL_UUID16 = $16
AVCTP_PROTOCOL_UUID16 = $17
AVDTP_PROTOCOL_UUID16 = $19
CMPT_PROTOCOL_UUID16 = $1B
UDI_C_PLANE_PROTOCOL_UUID16 = $1D
L2CAP_PROTOCOL_UUID16 = $100

;ServiceDiscoveryServerServiceClassID_UUID GUID $1000,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;BrowseGroupDescriptorServiceClassID_UUID GUID $1001,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;PublicBrowseGroupServiceClass_UUID GUID $1002,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB
;SerialPortServiceClass_UUID GUID $1101,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;LANAccessUsingPPPServiceClass_UUID GUID $1102,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;DialupNetworkingServiceClass_UUID GUID $1103,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;IrMCSyncServiceClass_UUID GUID $1104,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;OBEXObjectPushServiceClass_UUID GUID $1105,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;OBEXFileTransferServiceClass_UUID GUID $1106,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;IrMCSyncCommandServiceClass_UUID GUID $1107,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;HeadsetServiceClass_UUID GUID $1108,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;CordlessTelephonyServiceClass_UUID GUID $1109,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;AudioSourceServiceClass_UUID GUID $110A,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;AudioSinkServiceClass_UUID GUID $110B,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;AVRemoteControlTargetServiceClass_UUID GUID $110C,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;AdvancedAudioDistributionServiceClass_UUID GUID $110D,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;AVRemoteControlServiceClass_UUID GUID $110E,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;VideoConferencingServiceClass_UUID GUID $110F,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;IntercomServiceClass_UUID GUID $1110,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;FaxServiceClass_UUID GUID $1111,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;HeadsetAudioGatewayServiceClass_UUID GUID $1112,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;WAPServiceClass_UUID GUID $1113,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;WAPClientServiceClass_UUID GUID $1114,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;PANUServiceClass_UUID GUID $1115,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;NAPServiceClass_UUID GUID $1116,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;GNServiceClass_UUID GUID $1117,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;DirectPrintingServiceClass_UUID GUID $1118,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;ReferencePrintingServiceClass_UUID GUID $1119,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;ImagingServiceClass_UUID GUID $111A,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;ImagingResponderServiceClass_UUID GUID $111B,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;ImagingAutomaticArchiveServiceClass_UUID GUID $111C,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;ImagingReferenceObjectsServiceClass_UUID GUID $111D,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;HandsfreeServiceClass_UUID GUID $111E,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;HandsfreeAudioGatewayServiceClass_UUID GUID $111F,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;DirectPrintingReferenceObjectsServiceClass_UUID GUID $1120,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>

;ReflectedUIServiceClass_UUID GUID $1121,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;BasicPringingServiceClass_UUID GUID $1122,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;PrintingStatusServiceClass_UUID GUID $1123,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;HumanInterfaceDeviceServiceClass_UUID GUID $1124,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;HardcopyCableReplacementServiceClass_UUID GUID $1125,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;HCRPrintServiceClass_UUID GUID $1126,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;HCRScanServiceClass_UUID GUID $1127,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;CommonISDNAccessServiceClass_UUID GUID $1128,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;VideoConferencingGWServiceClass_UUID GUID $1129,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;UDIMTServiceClass_UUID GUID $112A,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;UDITAServiceClass_UUID GUID $112B,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;AudioVideoServiceClass_UUID GUID $112C,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>

;SimAccessServiceClass_UUID GUID $112D,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;PhonebookAccessPceServiceClass_UUID GUID $112E,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;PhonebookAccessPseServiceClass_UUID GUID $112F,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;PnPInformationServiceClass_UUID GUID $1200,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;GenericNetworkingServiceClass_UUID GUID $1201,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;GenericFileTransferServiceClass_UUID GUID $1202,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;GenericAudioServiceClass_UUID GUID $1203,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;GenericTelephonyServiceClass_UUID GUID $1204,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;UPnpServiceClass_UUID GUID $1205,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;UPnpIpServiceClass_UUID GUID $1206,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;ESdpUpnpIpPanServiceClass_UUID GUID $1300,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;ESdpUpnpIpLapServiceClass_UUID GUID $1301,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;ESdpUpnpL2capServiceClass_UUID GUID $1302,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;VideoSourceServiceClass_UUID GUID $1303,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;VideoSinkServiceClass_UUID GUID $1304,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>
;VideoDistributionServiceClass_UUID GUID $1305,0,$1000,<$80,0,0,$80,$5F,$9B,$34,$FB>

ServiceDiscoveryServerServiceClassID_UUID16 = $1000
BrowseGroupDescriptorServiceClassID_UUID16 = $1001
PublicBrowseGroupServiceClassID_UUID16 = $1002
SerialPortServiceClassID_UUID16 = $1101
LANAccessUsingPPPServiceClassID_UUID16 = $1102
DialupNetworkingServiceClassID_UUID16 = $1103
IrMCSyncServiceClassID_UUID16 = $1104
OBEXObjectPushServiceClassID_UUID16 = $1105
OBEXFileTransferServiceClassID_UUID16 = $1106
IrMcSyncCommandServiceClassID_UUID16 = $1107
HeadsetServiceClassID_UUID16 = $1108
CordlessServiceClassID_UUID16 = $1109
AudioSourceServiceClassID_UUID16 = $110A
AudioSinkSourceServiceClassID_UUID16 = $110B
AVRemoteControlTargetServiceClassID_UUID16 = $110C
AdvancedAudioDistributionServiceClassID_UUID16 = $110D
AVRemoteControlServiceClassID_UUID16 = $110E
VideoConferencingServiceClassID_UUID16 = $110F
IntercomServiceClassID_UUID16 = $1110
FaxServiceClassID_UUID16 = $1111
HeadsetAudioGatewayServiceClassID_UUID16 = $1112
WAPServiceClassID_UUID16 = $1113
WAPClientServiceClassID_UUID16 = $1114
PANUServiceClassID_UUID16 = $1115
NAPServiceClassID_UUID16 = $1116
GNServiceClassID_UUID16 = $1117
DirectPrintingServiceClassID_UUID16 = $1118
ReferencePrintingServiceClassID_UUID16 = $1119
ImagingServiceClassID_UUID16 = $111A
ImagingResponderServiceClassID_UUID16 = $111B
ImagingAutomaticArchiveServiceClassID_UUID16 = $111C
ImagingReferenceObjectsServiceClassID_UUID16 = $111D
HandsfreeServiceClassID_UUID16 = $111E
HandsfreeAudioGatewayServiceClassID_UUID16 = $111F
DirectPrintingReferenceObjectsServiceClassID_UUID16 = $1120

ReflectsUIServiceClassID_UUID16 = $1121
BasicPrintingServiceClassID_UUID16 = $1122
PrintingStatusServiceClassID_UUID16 = $1123
HumanInterfaceDeviceServiceClassID_UUID16 = $1124
HardcopyCableReplacementServiceClassID_UUID16 = $1125
HCRPrintServiceClassID_UUID16 = $1126
HCRScanServiceClassID_UUID16 = $1127
CommonISDNAccessServiceClass_UUID16 = $1128
VideoConferencingGWServiceClass_UUID16 = $1129
UDIMTServiceClass_UUID16 = $112A
UDITAServiceClass_UUID16 = $112B
AudioVideoServiceClass_UUID16 = $112C
PnPInformationServiceClassID_UUID16 = $1200
GenericNetworkingServiceClassID_UUID16 = $1201
GenericFileTransferServiceClassID_UUID16 = $1202
GenericAudioServiceClassID_UUID16 = $1203
GenericTelephonyServiceClassID_UUID16 = $1204

BTH_MAX_NAME_SIZE = 248
BTH_MAX_PIN_SIZE = 16
BTH_LINK_KEY_LENGTH = 16
BTH_MFG_ERICSSON = 0
BTH_MFG_NOKIA = 1
BTH_MFG_INTEL = 2
BTH_MFG_IBM = 3
BTH_MFG_TOSHIBA = 4
BTH_MFG_3COM = 5
BTH_MFG_MICROSOFT = 6
BTH_MFG_LUCENT = 7
BTH_MFG_MOTOROLA = 8
BTH_MFG_INFINEON = 9
BTH_MFG_CSR = 10
BTH_MFG_SILICONWAVE = 11
BTH_MFG_DIGIANSWER = 12
BTH_MFG_TI = 13
BTH_MFG_PARTHUS = 14
BTH_MFG_BROADCOM = 15
BTH_MFG_MITEL = 16
BTH_MFG_WIDCOMM = 17
BTH_MFG_ZEEVO = 18
BTH_MFG_ATMEL = 19
BTH_MFG_MITSIBUSHI = 20
BTH_MFG_RTX_TELECOM = 21
BTH_MFG_KC_TECHNOLOGY = 22
BTH_MFG_NEWLOGIC = 23
BTH_MFG_TRANSILICA = 24
BTH_MFG_ROHDE_SCHWARZ = 25
BTH_MFG_TTPCOM = 26
BTH_MFG_SIGNIA = 27
BTH_MFG_CONEXANT = 28
BTH_MFG_QUALCOMM = 29
BTH_MFG_INVENTEL = 30
BTH_MFG_AVM_BERLIN = 31
BTH_MFG_BANDSPEED = 32
BTH_MFG_MANSELLA = 33
BTH_MFG_NEC = 34
BTH_MFG_WAVEPLUS_TECHNOLOGY_CO = 35
BTH_MFG_ALCATEL = 36
BTH_MFG_PHILIPS_SEMICONDUCTOR  = 37
BTH_MFG_C_TECHNOLOGIES = 38
BTH_MFG_OPEN_INTERFACE = 39
BTH_MFG_RF_MICRO_DEVICES = 40
BTH_MFG_HITACHI = 41
BTH_MFG_SYMBOL_TECHNOLOGIES = 42
BTH_MFG_TENOVIS = 43
BTH_MFG_MACRONIX_INTERNATIONAL = 44
BTH_MFG_INTERNAL_USE = 65535

BTH_ADDR_NULL = $0000000000000000 ;ULONGLONG
NAP_MASK = $0000FFFF00000000 ;ULONGLONG
SAP_MASK = $00000000FFFFFFFF ;ULONGLONG
NAP_BIT_OFFSET = 8 * 4
SAP_BIT_OFFSET = 0

;GET_NAP     (_bth_addr)  ((USHORT) (((_bth_addr) & NAP_MASK) >> NAP_BIT_OFFSET))
;GET_SAP     (_bth_addr)  ((ULONG)  (((_bth_addr) & SAP_MASK) >> SAP_BIT_OFFSET))
;SET_NAP     (_nap) (((ULONGLONG) ((USHORT) (_nap))) << NAP_BIT_OFFSET)
;SET_SAP     (_sap) (((ULONGLONG) ((ULONG)  (_sap))) << SAP_BIT_OFFSET)
;SET_NAP_SAP (_nap, _sap) (SET_NAP(_nap) | SET_SAP(_sap))

COD_FORMAT_BIT_OFFSET = 0
COD_MINOR_BIT_OFFSET = 2
COD_MAJOR_BIT_OFFSET = 8 * 1
COD_SERVICE_BIT_OFFSET = 8 * 1 + 5
COD_FORMAT_MASK = 3
COD_MINOR_MASK = $FC
COD_MAJOR_MASK = $1F00
COD_SERVICE_MASK = $FFE000

;GET_COD_FORMAT  (_cod) ((_cod) & COD_FORMAT_MASK   >> COD_FORMAT_BIT_OFFSET)
;GET_COD_MINOR   (_cod) (((_cod) & COD_MINOR_MASK)   >> COD_MINOR_BIT_OFFSET)
;GET_COD_MAJOR   (_cod) (((_cod) & COD_MAJOR_MASK)   >> COD_MAJOR_BIT_OFFSET)
;GET_COD_SERVICE (_cod) (((_cod) & COD_SERVICE_MASK) >> COD_SERVICE_BIT_OFFSET)
;SET_COD_MINOR   (_cod, _minor)(_cod) = \
;                ((_cod) & ~COD_MINOR_MASK) | ((_minor) << COD_MINOR_BIT_OFFSET)
;SET_COD_MAJOR   (_cod, _major)   (_cod) =\
;                ((_cod) & ~COD_MAJOR_MASK) | ((_major) << COD_MAJOR_BIT_OFFSET)
;SET_COD_SERVICE (_cod, _service) (_cod) =\
;                ((_cod) & ~COD_SERVICE_MASK) | ((_service) << COD_SERVICE_BIT_OFFSET)

COD_VERSION = 0
COD_SERVICE_LIMITED = 1
COD_SERVICE_POSITIONING = 8
COD_SERVICE_NETWORKING = $10
COD_SERVICE_RENDERING = $20
COD_SERVICE_CAPTURING = $40
COD_SERVICE_OBJECT_XFER = $80
COD_SERVICE_AUDIO = $100
COD_SERVICE_TELEPHONY = $200
COD_SERVICE_INFORMATION = $400

COD_SERVICE_VALID_MASK = (COD_SERVICE_LIMITED or COD_SERVICE_POSITIONING or\
			  COD_SERVICE_NETWORKING or COD_SERVICE_RENDERING or\
			  COD_SERVICE_CAPTURING or COD_SERVICE_OBJECT_XFER or\
			  COD_SERVICE_AUDIO or COD_SERVICE_TELEPHONY or COD_SERVICE_INFORMATION)

COD_SERVICE_MAX_COUNT = 9

COD_MAJOR_MISCELLANEOUS = 0
COD_MAJOR_COMPUTER = 1
COD_MAJOR_PHONE = 2
COD_MAJOR_LAN_ACCESS = 3
COD_MAJOR_AUDIO = 4
COD_MAJOR_PERIPHERAL = 5
COD_MAJOR_IMAGING = 6
COD_MAJOR_UNCLASSIFIED = $1F

COD_COMPUTER_MINOR_UNCLASSIFIED = 0
COD_COMPUTER_MINOR_DESKTOP = 1
COD_COMPUTER_MINOR_SERVER = 2
COD_COMPUTER_MINOR_LAPTOP = 3
COD_COMPUTER_MINOR_HANDHELD = 4
COD_COMPUTER_MINOR_PALM = 5
COD_COMPUTER_MINOR_WEARABLE = 6

COD_PHONE_MINOR_UNCLASSIFIED = 0
COD_PHONE_MINOR_CELLULAR = 1
COD_PHONE_MINOR_CORDLESS = 2
COD_PHONE_MINOR_SMART = 3
COD_PHONE_MINOR_WIRED_MODEM = 4

COD_AUDIO_MINOR_UNCLASSIFIED = 0
COD_AUDIO_MINOR_HEADSET = 1
COD_AUDIO_MINOR_HANDS_FREE = 2
COD_AUDIO_MINOR_HEADSET_HANDS_FREE = 3
COD_AUDIO_MINOR_MICROPHONE = 4
COD_AUDIO_MINOR_LOUDSPEAKER = 5
COD_AUDIO_MINOR_HEADPHONES = 6
COD_AUDIO_MINOR_PORTABLE_AUDIO = 7
COD_AUDIO_MINOR_CAR_AUDIO = 8
COD_AUDIO_MINOR_SET_TOP_BOX = 9
COD_AUDIO_MINOR_HIFI_AUDIO = $A
COD_AUDIO_MINOR_VCR = $B
COD_AUDIO_MINOR_VIDEO_CAMERA = $C
COD_AUDIO_MINOR_CAMCORDER = $D
COD_AUDIO_MINOR_VIDEO_MONITOR = $E
COD_AUDIO_MINOR_VIDEO_DISPLAY_LOUDSPEAKER = $F
COD_AUDIO_MINOR_VIDEO_DISPLAY_CONFERENCING = $10
COD_AUDIO_MINOR_GAMING_TOY = $12

COD_PERIPHERAL_MINOR_KEYBOARD_MASK = $10
COD_PERIPHERAL_MINOR_POINTER_MASK = $20
COD_PERIPHERAL_MINOR_NO_CATEGORY = 0
COD_PERIPHERAL_MINOR_JOYSTICK = 1
COD_PERIPHERAL_MINOR_GAMEPAD = 2
COD_PERIPHERAL_MINOR_REMOTE_CONTROL = 3
COD_PERIPHERAL_MINOR_SENSING = 4

COD_IMAGING_MINOR_DISPLAY_MASK = 4
COD_IMAGING_MINOR_CAMERA_MASK = 8
COD_IMAGING_MINOR_SCANNER_MASK = $10
COD_IMAGING_MINOR_PRINTER_MASK = $20

COD_LAN_ACCESS_BIT_OFFSET = 5
COD_LAN_MINOR_MASK = $1C
COD_LAN_ACCESS_MASK = $E0
;GET_COD_LAN_MINOR(_cod)  (((_cod) & COD_LAN_MINOR_MASK) >> COD_MINOR_BIT_OFFSET)
;GET_COD_LAN_ACCESS(_cod) (((_cod) & COD_LAN_ACCESS_MASK) >> COD_LAN_ACCESS_BIT_OFFSET)

COD_LAN_MINOR_UNCLASSIFIED = 0
COD_LAN_ACCESS_0_USED = 0
COD_LAN_ACCESS_17_USED = 1
COD_LAN_ACCESS_33_USED = 2
COD_LAN_ACCESS_50_USED = 3
COD_LAN_ACCESS_67_USED = 4
COD_LAN_ACCESS_83_USED = 5
COD_LAN_ACCESS_99_USED = 6
COD_LAN_ACCESS_FULL = 7

LAP_GIAC_INIT equ $33, $8B, $9E
LAP_LIAC_INIT equ $00, $8B, $9E
LAP_GIAC_VALUE = $9E8B33
LAP_LIAC_VALUE = $9E8B00

BTH_ADDR_IAC_FIRST = $9E8B00
BTH_ADDR_IAC_LAST = $9E8B3f
BTH_ADDR_LIAC = $9E8B00
BTH_ADDR_GIAC = $9E8B33

;BTH_ERROR(_btStatus)   ((_btStatus) != BTH_ERROR_SUCCESS)
;BTH_SUCCESS(_btStatus) ((_btStatus) == BTH_ERROR_SUCCESS)
BTH_ERROR_SUCCESS = 0
BTH_ERROR_UNKNOWN_HCI_COMMAND = 1
BTH_ERROR_NO_CONNECTION = 2
BTH_ERROR_HARDWARE_FAILURE = 3
BTH_ERROR_PAGE_TIMEOUT = 4
BTH_ERROR_AUTHENTICATION_FAILURE = 5
BTH_ERROR_KEY_MISSING = 6
BTH_ERROR_MEMORY_FULL = 7
BTH_ERROR_CONNECTION_TIMEOUT = 8
BTH_ERROR_MAX_NUMBER_OF_CONNECTIONS = 9
BTH_ERROR_MAX_NUMBER_OF_SCO_CONNECTIONS = $a
BTH_ERROR_ACL_CONNECTION_ALREADY_EXISTS = $b
BTH_ERROR_COMMAND_DISALLOWED = $c
BTH_ERROR_HOST_REJECTED_LIMITED_RESOURCES = $d
BTH_ERROR_HOST_REJECTED_SECURITY_REASONS = $e
BTH_ERROR_HOST_REJECTED_PERSONAL_DEVICE = $f
BTH_ERROR_HOST_TIMEOUT = $10
BTH_ERROR_UNSUPPORTED_FEATURE_OR_PARAMETER = $11
BTH_ERROR_INVALID_HCI_PARAMETER = $12
BTH_ERROR_REMOTE_USER_ENDED_CONNECTION = $13
BTH_ERROR_REMOTE_LOW_RESOURCES = $14
BTH_ERROR_REMOTE_POWERING_OFF = $15
BTH_ERROR_LOCAL_HOST_TERMINATED_CONNECTION = $16
BTH_ERROR_REPEATED_ATTEMPTS = $17
BTH_ERROR_PAIRING_NOT_ALLOWED = $18
BTH_ERROR_UKNOWN_LMP_PDU = $19
BTH_ERROR_UNSUPPORTED_REMOTE_FEATURE = $1a
BTH_ERROR_SCO_OFFSET_REJECTED = $1b
BTH_ERROR_SCO_INTERVAL_REJECTED = $1c
BTH_ERROR_SCO_AIRMODE_REJECTED = $1d
BTH_ERROR_INVALID_LMP_PARAMETERS = $1e
BTH_ERROR_UNSPECIFIED_ERROR = $1f
BTH_ERROR_UNSUPPORTED_LMP_PARM_VALUE = $20
BTH_ERROR_ROLE_CHANGE_NOT_ALLOWED = $21
BTH_ERROR_LMP_RESPONSE_TIMEOUT = $22
BTH_ERROR_LMP_TRANSACTION_COLLISION = $23
BTH_ERROR_LMP_PDU_NOT_ALLOWED = $24
BTH_ERROR_ENCRYPTION_MODE_NOT_ACCEPTABLE = $25
BTH_ERROR_UNIT_KEY_NOT_USED = $26
BTH_ERROR_QOS_IS_NOT_SUPPORTED = $27
BTH_ERROR_INSTANT_PASSED = $28
BTH_ERROR_PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED = $29
BTH_ERROR_UNSPECIFIED = $FF

L2CAP_MIN_MTU = 48
L2CAP_MAX_MTU = $FFFF
L2CAP_DEFAULT_MTU = 672
MAX_L2CAP_PING_DATA_LENGTH = 44
MAX_L2CAP_INFO_DATA_LENGTH = 44

BDIF_ADDRESS = 1
BDIF_COD = 2
BDIF_NAME = 4
BDIF_PAIRED = 8
BDIF_PERSONAL = $10
BDIF_CONNECTED = $20

BDIF_VALID_FLAGS = (BDIF_ADDRESS or BDIF_COD or BDIF_NAME or BDIF_PAIRED or BDIF_PERSONAL or\
		    BDIF_CONNECTED)

struct BTHDEVICEINFO
       flags dd ?,?
       address dq ?
       classOfDevice dd ?
       name db BTH_MAX_NAME_SIZE+4 dup(?)
ends

struct BTHRADIOINRANGE
       deviceInfo BTHDEVICEINFO
       previousDeviceFlags dd ?,?
ends

struct BTHL2CAPEVENTINFO
       bthAddress dq ?
       psm dw ?
       connected db ?
       initiated db ?,?,?,?,?
ends

HCI_CONNNECTION_TYPE_ACL = 1
HCI_CONNNECTION_TYPE_SCO = 2

struct BTHHCIEVENTINFO
       bthAddress dq ?
       connectionType db ?
       connected db 7 dup(?)
ends

BTH_MAX_SERVICE_NAME_SIZE = 256
MAX_UUIDS_IN_QUERY = 12
BTH_VID_DEFAULT_VALUE = $FFFF

SDP_ERROR_INVALID_SDP_VERSION = 1
SDP_ERROR_INVALID_RECORD_HANDLE = 2
SDP_ERROR_INVALID_REQUEST_SYNTAX = 3
SDP_ERROR_INVALID_PDU_SIZE = 4
SDP_ERROR_INVALID_CONTINUATION_STATE = 5
SDP_ERROR_INSUFFICIENT_RESOURCES = 6

SDP_ERROR_SUCCESS = 0
SDP_ERROR_SERVER_INVALID_RESPONSE = $100
SDP_ERROR_SERVER_RESPONSE_DID_NOT_PARSE = $200
SDP_ERROR_SERVER_BAD_FORMAT = $300
SDP_ERROR_COULD_NOT_SEND_CONTINUE  = $400
SDP_ERROR_RESPONSE_TOO_LARGE = $500

SDP_ATTRIB_RECORD_HANDLE = 0
SDP_ATTRIB_CLASS_ID_LIST = 1
SDP_ATTRIB_RECORD_STATE = 2
SDP_ATTRIB_SERVICE_ID = 3
SDP_ATTRIB_PROTOCOL_DESCRIPTOR_LIST = 4
SDP_ATTRIB_BROWSE_GROUP_LIST = 5
SDP_ATTRIB_LANG_BASE_ATTRIB_ID_LIST = 6
SDP_ATTRIB_INFO_TIME_TO_LIVE = 7
SDP_ATTRIB_AVAILABILITY = 8
SDP_ATTRIB_PROFILE_DESCRIPTOR_LIST = 9
SDP_ATTRIB_DOCUMENTATION_URL = $A
SDP_ATTRIB_CLIENT_EXECUTABLE_URL = $B
SDP_ATTRIB_ICON_URL = $C
SDP_ATTRIB_ADDITIONAL_PROTOCOL_DESCRIPTOR_LIST = $D
SDP_ATTRIB_PROFILE_SPECIFIC = $200

LANG_BASE_LANGUAGE_INDEX = 0
LANG_BASE_ENCODING_INDEX = 1
LANG_BASE_OFFSET_INDEX = 2
LANG_DEFAULT_ID = $100

STRING_NAME_OFFSET = 0
STRING_DESCRIPTION_OFFSET = 1
STRING_PROVIDER_NAME_OFFSET = 2

SDP_ATTRIB_SDP_VERSION_NUMBER_LIST = $200
SDP_ATTRIB_SDP_DATABASE_STATE = $201
SDP_ATTRIB_BROWSE_GROUP_ID = $200
SDP_ATTRIB_CORDLESS_EXTERNAL_NETWORK = $301
SDP_ATTRIB_FAX_CLASS_1_SUPPORT = $302
SDP_ATTRIB_FAX_CLASS_2_0_SUPPORT = $303
SDP_ATTRIB_FAX_CLASS_2_SUPPORT = $304
SDP_ATTRIB_FAX_AUDIO_FEEDBACK_SUPPORT = $305
SDP_ATTRIB_HEADSET_REMOTE_AUDIO_VOLUME_CONTROL = $302
SDP_ATTRIB_LAN_LPSUBNET = $200
SDP_ATTRIB_OBJECT_PUSH_SUPPORTED_FORMATS_LIST = $303
SDP_ATTRIB_SYNCH_SUPPORTED_DATA_STORES_LIST = $301
SDP_ATTRIB_SERVICE_VERSION = $300

SDP_ATTRIB_PAN_NETWORK_ADDRESS = $306
SDP_ATTRIB_PAN_WAP_GATEWAY = $307
SDP_ATTRIB_PAN_HOME_PAGE_URL = $308
SDP_ATTRIB_PAN_WAP_STACK_TYPE = $309
SDP_ATTRIB_PAN_SECURITY_DESCRIPTION = $30A
SDP_ATTRIB_PAN_NET_ACCESS_TYPE = $30B
SDP_ATTRIB_PAN_MAX_NET_ACCESS_RATE = $30C

SDP_ATTRIB_IMAGING_SUPPORTED_CAPABILITIES = $310
SDP_ATTRIB_IMAGING_SUPPORTED_FEATURES = $311
SDP_ATTRIB_IMAGING_SUPPORTED_FUNCTIONS = $312
SDP_ATTRIB_IMAGING_TOTAL_DATA_CAPACITY = $313

SDP_ATTRIB_DI_SPECIFICATION_ID = $200
SDP_ATTRIB_DI_VENDOR_ID = $201
SDP_ATTRIB_DI_PRODUCT_ID = $202
SDP_ATTRIB_DI_VERSION = $203
SDP_ATTRIB_DI_PRIMARY_RECORD = $204
SDP_ATTRIB_DI_VENDOR_ID_SOURCE = $205

SDP_ATTRIB_HID_DEVICE_RELEASE_NUMBER = $200
SDP_ATTRIB_HID_PARSER_VERSION = $201
SDP_ATTRIB_HID_DEVICE_SUBCLASS = $202
SDP_ATTRIB_HID_COUNTRY_CODE = $203
SDP_ATTRIB_HID_VIRTUAL_CABLE = $204
SDP_ATTRIB_HID_RECONNECT_INITIATE = $205
SDP_ATTRIB_HID_DESCRIPTOR_LIST = $206
SDP_ATTRIB_HID_LANG_ID_BASE_LIST = $207
SDP_ATTRIB_HID_SDP_DISABLE = $208
SDP_ATTRIB_HID_BATTERY_POWER = $209
SDP_ATTRIB_HID_REMOTE_WAKE = $20A
SDP_ATTRIB_HID_REPORT_LIST = $20B
SDP_ATTRIB_HID_SUPERVISION_TIMEOUT = $20C
SDP_ATTRIB_HID_NORMALLY_CONNECTABLE = $20D
SDP_ATTRIB_HID_BOOT_DEVICE = $20E

CORDLESS_EXTERNAL_NETWORK_PSTN = 1
CORDLESS_EXTERNAL_NETWORK_ISDN = 2
CORDLESS_EXTERNAL_NETWORK_GSM = 3
CORDLESS_EXTERNAL_NETWORK_CDMA = 4
CORDLESS_EXTERNAL_NETWORK_ANALOG_CELLULAR = 5
CORDLESS_EXTERNAL_NETWORK_PACKET_SWITCHED = 6
CORDLESS_EXTERNAL_NETWORK_OTHER = 7

OBJECT_PUSH_FORMAT_VCARD_2_1 = 1
OBJECT_PUSH_FORMAT_VCARD_3_0 = 2
OBJECT_PUSH_FORMAT_VCAL_1_0 = 3
OBJECT_PUSH_FORMAT_ICAL_2_0 = 4
OBJECT_PUSH_FORMAT_VNOTE = 5
OBJECT_PUSH_FORMAT_VMESSAGE = 6
OBJECT_PUSH_FORMAT_ANY = $FF

SYNCH_DATA_STORE_PHONEBOOK = 1
SYNCH_DATA_STORE_CALENDAR = 3
SYNCH_DATA_STORE_NOTES = 5
SYNCH_DATA_STORE_MESSAGES = 6

DI_VENDOR_ID_SOURCE_BLUETOOTH_SIG = 1
DI_VENDOR_ID_SOURCE_USB_IF = 2

PSM_SDP = 1
PSM_RFCOMM = 3
PSM_TCS_BIN = 5
PSM_TCS_BIN_CORDLESS = 7
PSM_BNEP = $F
PSM_HID_CONTROL = $11
PSM_HID_INTERRUPT = $13
PSM_AVCTP = $17
PSM_AVDTP = $19
PSM_UDI_C_PLANE = $1D

STR_ADDR_FMTA equ "(%02x:%02x:%02x:%02x:%02x:%02x)"
STR_ADDR_FMTW equ "(%02x:%02x:%02x:%02x:%02x:%02x)"

STR_ADDR_SHORT_FMTA equ "%04x%08x"
STR_ADDR_SHORT_FMTW equ "%04x%08x"

;GET_BITS(field,offset,mask)  ( ( (field) >> (offset) ) & (mask) )
;GET_BIT(field,offset)        ( GET_BITS(field,offset,0x1) )

;LMP_3_SLOT_PACKETS(x)               (GET_BIT(x, 0))
;LMP_5_SLOT_PACKETS(x)               (GET_BIT(x, 1))
;LMP_ENCRYPTION(x)                   (GET_BIT(x, 2))
;LMP_SLOT_OFFSET(x)                  (GET_BIT(x, 3))
;LMP_TIMING_ACCURACY(x)              (GET_BIT(x, 4))
;LMP_SWITCH(x)                       (GET_BIT(x, 5))
;LMP_HOLD_MODE(x)                    (GET_BIT(x, 6))
;LMP_SNIFF_MODE(x)                   (GET_BIT(x, 7))
;LMP_PARK_MODE(x)                    (GET_BIT(x, 8))
;LMP_RSSI(x)                         (GET_BIT(x, 9))
;LMP_CHANNEL_QUALITY_DRIVEN_MODE(x)  (GET_BIT(x,10))
;LMP_SCO_LINK(x)                     (GET_BIT(x,11))
;LMP_HV2_PACKETS(x)                  (GET_BIT(x,12))
;LMP_HV3_PACKETS(x)                  (GET_BIT(x,13))
;LMP_MU_LAW_LOG(x)                   (GET_BIT(x,14))
;LMP_A_LAW_LOG(x)                    (GET_BIT(x,15))
;LMP_CVSD(x)                         (GET_BIT(x,16))
;LMP_PAGING_SCHEME(x)                (GET_BIT(x,17))
;LMP_POWER_CONTROL(x)                (GET_BIT(x,18))
;LMP_TRANSPARENT_SCO_DATA(x)         (GET_BIT(x,19))
;LMP_FLOW_CONTROL_LAG(x)             (GET_BITS(x,20,0x3))
;LMP_BROADCAST_ENCRYPTION(x)         (GET_BIT(x,23))
;LMP_ENHANCED_INQUIRY_SCAN(x)        (GET_BIT(x,27))
;LMP_INTERLACED_INQUIRY_SCAN(x)      (GET_BIT(x,28))
;LMP_INTERLACED_PAGE_SCAN(x)         (GET_BIT(x,29))
;LMP_RSSI_WITH_INQUIRY_RESULTS(x)    (GET_BIT(x,30))
;LMP_ESCO_LINK(x)                    (GET_BIT(x,31))
;LMP_EV4_PACKETS(x)                  (GET_BIT(x,32))
;LMP_EV5_PACKETS(x)                  (GET_BIT(x,33))
;LMP_AFH_CAPABLE_SLAVE(x)            (GET_BIT(x,35))
;LMP_AFH_CLASSIFICATION_SLAVE(x)     (GET_BIT(x,36))
;LMP_AFH_CAPABLE_MASTER(x)           (GET_BIT(x,43))
;LMP_AFH_CLASSIFICATION_MASTER(x)    (GET_BIT(x,44))
;LMP_EXTENDED_FEATURES(x)            (GET_BIT(x,63))

BT_PORT_ANY = -1
BT_PORT_MIN = 1
BT_PORT_MAX = $ffff
BT_PORT_DYN_FIRST = $1001

AF_BTH = 32
PF_BTH = AF_BTH
NS_BTH = 16

struct SOCKADDRBTH
       addressFamily dw ?
       btAddr dq ?
       serviceClassId GUID
       port dd ?
ends

;SVCID_BTH_PROVIDER GUID $6aa63e0,$7d60,$41ff,<$af,$b2,$3e,$e6,$d2,$d9,$39,$2d>
BTH_ADDR_STRING_SIZE = 12

BTHPROTO_RFCOMM = 3
BTHPROTO_L2CAP = $100

SOL_RFCOMM = BTHPROTO_RFCOMM
SOL_L2CAP = BTHPROTO_L2CAP
SOL_SDP = $101

SO_BTH_AUTHENTICATE = $80000001
SO_BTH_ENCRYPT = 2
SO_BTH_MTU = $80000007
SO_BTH_MTU_MAX = $80000008
SO_BTH_MTU_MIN = $8000000a

RFCOMM_MAX_MTU = $3F3
RFCOMM_MIN_MTU = $17
BTH_SDP_VERSION = 1

struct BTHSETSERVICE
       pSdpVersion dq ?
       pRecordHandle dq ?
       fCodService dd ?
       Reserved dd 5 dup(?)
       ulRecordLength dd ?
       pRecord db ?
ends

SDP_DEFAULT_INQUIRY_SECONDS = 6
SDP_MAX_INQUIRY_SECONDS = 60
SDP_DEFAULT_INQUIRY_MAX_RESPONSES = 255
SDP_SERVICE_SEARCH_REQUEST = 1
SDP_SERVICE_ATTRIBUTE_REQUEST = 2
SDP_SERVICE_SEARCH_ATTRIBUTE_REQUEST = 3

struct BTHQUERYDEVICE
       LAP dd ?
       length db ?
ends

struct BTHQUERYSERVICE
       type dd ?
       serviceHandle dd ?
       uuids SDPQUERYUUID
	     db (MAX_UUIDS_IN_QUERY-1) * sizeof.SDPQUERYUUID dup(?)
       numRange dd ?
       pRange SDPATTRIBUTERANGE
ends

BTHNS_RESULT_DEVICE_CONNECTED = $10000
BTHNS_RESULT_DEVICE_REMEMBERED = $20000
BTHNS_RESULT_DEVICE_AUTHENTICATED = $40000

SIO_RFCOMM_SEND_COMMAND = $D8000065
SIO_RFCOMM_WAIT_COMMAND = $D8000066

SIO_BTH_PING = $D8000008
SIO_BTH_INFO = $D8000009
SIO_RFCOMM_SESSION_FLOW_OFF = $D8000067
SIO_RFCOMM_TEST = $D8000068
SIO_RFCOMM_USECFC = $D8000069

MSC_EA_BIT = 1 ;EA_BIT (??? Where is this defined ???)
MSC_FC_BIT = 2
MSC_RTC_BIT = 4
MSC_RTR_BIT = 8
MSC_RESERVED = 16 or 32
MSC_IC_BIT = 64
MSC_DV_BIT = 128
MSC_BREAK_BIT = 2

macro MSC_SET_BREAK_LENGTH b, l {
      VALUE = ((b and 3) or (l and $f) shl 4)
}

struct RFCOMMMSCDATA
       Signals db ?
       Break db ?
ends

RLS_ERROR = 1
RLS_OVERRUN = 2
RLS_PARITY = 4
RLS_FRAMING = 8

struct RFCOMMRLSDATA
       LineStatus db ?
ends

RPN_BAUD_2400 = 0
RPN_BAUD_4800 = 1
RPN_BAUD_7200 = 2
RPN_BAUD_9600 = 3
RPN_BAUD_19200 = 4
RPN_BAUD_38400 = 5
RPN_BAUD_57600 = 6
RPN_BAUD_115200 = 7
RPN_BAUD_230400 = 8
RPN_DATA_5 = 0
RPN_DATA_6 = 1
RPN_DATA_7 = 2
RPN_DATA_8 = 3

RPN_STOP_1 = 0
RPN_STOP_1_5 = 4

RPN_PARITY_NONE = 0
RPN_PARITY_ODD = 8
RPN_PARITY_EVEN = $18
RPN_PARITY_MARK = $28
RPN_PARITY_SPACE = $38

RPN_FLOW_X_IN = 1
RPN_FLOW_X_OUT = 2
RPN_FLOW_RTR_IN = 4
RPN_FLOW_RTR_OUT = 8
RPN_FLOW_RTC_IN = $10
RPN_FLOW_RTC_OUT = $20
RPN_PARAM_BAUD = 1
RPN_PARAM_DATA = 2
RPN_PARAM_STOP = 4
RPN_PARAM_PARITY = 8
RPN_PARAM_P_TYPE = $10
RPN_PARAM_XON = $20
RPN_PARAM_XOFF = $40
RPN_PARAM_X_IN = 1
RPN_PARAM_X_OUT = 2
RPN_PARAM_RTR_IN = 4
RPN_PARAM_RTR_OUT = 8
RPN_PARAM_RTC_IN = $10
RPN_PARAM_RTC_OUT = $20

struct RFCOMMRPNDATA
       Baud db ?
       Data db ?
       FlowControl db ?
       XonChar db ?
       XoffChar db ?
       ParameterMask1 db ?
       ParameterMask2 db ?
ends

RFCOMM_CMD_NONE = 0
RFCOMM_CMD_MSC = 1
RFCOMM_CMD_RLS = 2
RFCOMM_CMD_RPN = 3
RFCOMM_CMD_RPN_REQUEST = 4
RFCOMM_CMD_RPN_RESPONSE = 5

struct RFCOMMCOMMAND
       CmdType dd ?
       union
	   MSC RFCOMMMSCDATA
	   RLS RFCOMMRLSDATA
	   RPN RFCOMMRPNDATA
       ends
ends

struct BTHPINGREQ
       btAddr dq ?
       dataLen db ?
       data db MAX_L2CAP_PING_DATA_LENGTH dup(?)
ends

struct BTHPINGRSP
       dataLen db ?
       data db MAX_L2CAP_PING_DATA_LENGTH dup(?)
ends

struct BTHINFOREQ
       btAddr dq ?
       infoType dw ?
ends

struct BTHINFORSP
       result dw ?
       dataLen db ?
       union
	   connectionlessMTU dw ?
	   data db MAX_L2CAP_INFO_DATA_LENGTH dup(?)
       ends
ends

;Copyright (c) 1997-1999  Microsoft Corporation
;Module Name:  ws2atm.h
;Abstract:  Winsock 2 ATM Annex definitions.

ATMPROTO_AALUSER = 0
ATMPROTO_AAL1 = 1
ATMPROTO_AAL2 = 2
ATMPROTO_AAL34 = 3
ATMPROTO_AAL5 = 5

SAP_FIELD_ABSENT = $FFFFFFFE
SAP_FIELD_ANY = $FFFFFFFF
SAP_FIELD_ANY_AESA_SEL = $FFFFFFFA
SAP_FIELD_ANY_AESA_REST = $FFFFFFFB

ATM_E164 = 1
ATM_NSAP = 2
ATM_AESA = 2

ATM_ADDR_SIZE = 20

struct ATMADDRESS
       AddressType dd ?
       NumofDigits dd ?
       Addr db ATM_ADDR_SIZE dup(?)
ends

BLLI_L2_ISO_1745 = 1
BLLI_L2_Q921 = 2
BLLI_L2_X25L = 6
BLLI_L2_X25M = 7
BLLI_L2_ELAPB = 8
BLLI_L2_HDLC_ARM = 9
BLLI_L2_HDLC_NRM = $A
BLLI_L2_HDLC_ABM = $B
BLLI_L2_LLC = $C
BLLI_L2_X75 = $D
BLLI_L2_Q922 = $E
BLLI_L2_USER_SPECIFIED = 10
BLLI_L2_ISO_7776 = 11

BLLI_L3_X25 = 6
BLLI_L3_ISO_8208 = 7
BLLI_L3_X223 = 8
BLLI_L3_SIO_8473 = 9
BLLI_L3_T70 = $A
BLLI_L3_ISO_TR9577 = $B
BLLI_L3_USER_SPECIFIED = $10
BLLI_L3_IPI_SNAP = $80
BLLI_L3_IPI_IP = $CC

struct ATMBLLI
       Layer2Protocol dd ?
       Layer2UserSpecifiedProtocol dd ?
       Layer3Protocol dd ?
       Layer3UserSpecifiedProtocol dd ?
       Layer3IPI dd ?
       SnapID db 8 dup(?)
ends

BHLI_ISO = 0
BHLI_UserSpecific = 1
BHLI_HighLayerProfile = 2
BHLI_VendorSpecificAppId = 3

struct ATMBHLI
       HighLayerInfoType dd ?
       HighLayerInfoLength dd ?
       HighLayerInfo db 8 dup(?)
ends

struct SOCKADDRATM
       satm_family dw ?,?
       satm_number ATMADDRESS
       satm_blli ATMBLLI
       satm_bhli ATMBHLI
ends

IE_AALParameters = 0
IE_TrafficDescriptor = 1
IE_BroadbandBearerCapability = 2
IE_BHLI = 3
IE_BLLI = 4
IE_CalledPartyNumber = 5
IE_CalledPartySubaddress = 6
IE_CallingPartyNumber = 7
IE_CallingPartySubaddress = 8
IE_Cause = 9
IE_QOSClass = 10
IE_TransitNetworkSelection = 11

struct Q2931IE
       IEType dd ?
       IELength dd ?
       IE db 4 dup(?)
ends

AALTYPE_5 = 5
AALTYPE_USER = 16

AAL5_MODE_MESSAGE = 1
AAL5_MODE_STREAMING = 2
AAL5_SSCS_NULL = 0
AAL5_SSCS_SSCOP_ASSURED = 1
AAL5_SSCS_SSCOP_NON_ASSURED = 2
AAL5_SSCS_FRAME_RELAY = 4

struct AAL5PARAMETERS
       ForwardMaxCPCSSDUSize dd ?
       BackwardMaxCPCSSDUSize dd ?
       Mode db ?
       SSCSType db ?,?,?
ends

struct AALUSERPARAMETERS
       UserDefined dd ?
ends

struct AALPARAMETERSIE
       AALType dd ?
       union
	   AAL5Parameters AAL5PARAMETERS
	   AALUserParameters AALUSERPARAMETERS
       ends
ends

struct ATMTD
       PeakCellRate_CLP0 dd ?
       PeakCellRate_CLP01 dd ?
       SustainableCellRate_CLP0 dd ?
       SustainableCellRate_CLP01 dd ?
       MaxBurstSize_CLP0 dd ?
       MaxBurstSize_CLP01 dd ?
       Tagging dd ?
ends

struct ATMTRAFFICDESCRIPTORIE
       Forward ATMTD
       Backward ATMTD
       BestEffort dd ?
ends

BCOB_A = 1
BCOB_C = 3
BCOB_X = $10
TT_NOIND = 0
TT_CBR = 4
TT_VBR = 8
TR_NOIND = 0
TR_END_TO_END = 1
TR_NO_END_TO_END = 2
CLIP_NOT = 0
CLIP_SUS = $20
UP_P2P = 0
UP_P2MP = 1

struct ATMBROADBANDBEARERCAPABILITYIE
       BearerClass db ?
       TrafficType db ?
       TimingRequirements db ?
       ClippingSusceptability db ?
       UserPlaneConnectionConfig db ?
ends

BLLI_L2_MODE_NORMAL = $40
BLLI_L2_MODE_EXT = $80
BLLI_L3_MODE_NORMAL = $40
BLLI_L3_MODE_EXT = $80
BLLI_L3_PACKET_16 = 4
BLLI_L3_PACKET_32 = 5
BLLI_L3_PACKET_64 = 6
BLLI_L3_PACKET_128 = 7
BLLI_L3_PACKET_256 = 8
BLLI_L3_PACKET_512 = 9
BLLI_L3_PACKET_1024 = $A
BLLI_L3_PACKET_2048 = $B
BLLI_L3_PACKET_4096 = $C

struct ATMBLLIIE
       Layer2Protocol dd ?
       Layer2Mode db ?
       Layer2WindowSize db ?,?,?
       Layer2UserSpecifiedProtocol dd ?
       Layer3Protocol dd ?
       Layer3Mode db ?
       Layer3DefaultPacketSize db ?
       Layer3PacketWindowSize db ?,?
       Layer3UserSpecifiedProtocol dd ?
       Layer3IPI dd ?
       SnapID db 8 dup(?)
ends

PI_ALLOWED = 0
PI_RESTRICTED = $40
PI_NUMBER_NOT_AVAILABLE = $80
SI_USER_NOT_SCREENED = 0
SI_USER_PASSED = 1
SI_USER_FAILED = 2
SI_NETWORK = 3

struct ATMCALLINGPARTYNUMBERIE
       ATM_Number ATMADDRESS
       Presentation_Indication db ?
       Screening_Indicator db ?,?,?
ends

CAUSE_LOC_USER = 0
CAUSE_LOC_PRIVATE_LOCAL = 1
CAUSE_LOC_PUBLIC_LOCAL = 2
CAUSE_LOC_TRANSIT_NETWORK = 3
CAUSE_LOC_PUBLIC_REMOTE = 4
CAUSE_LOC_PRIVATE_REMOTE = 5
CAUSE_LOC_INTERNATIONAL_NETWORK = 7
CAUSE_LOC_BEYOND_INTERWORKING = $A
CAUSE_UNALLOCATED_NUMBER = 1
CAUSE_NO_ROUTE_TO_TRANSIT_NETWORK = 2
CAUSE_NO_ROUTE_TO_DESTINATION = 3
CAUSE_VPI_VCI_UNACCEPTABLE = $A
CAUSE_NORMAL_CALL_CLEARING = $10
CAUSE_USER_BUSY = $11
CAUSE_NO_USER_RESPONDING = $12
CAUSE_CALL_REJECTED = $15
CAUSE_NUMBER_CHANGED = $16
CAUSE_USER_REJECTS_CLIR = $17
CAUSE_DESTINATION_OUT_OF_ORDER = $1B
CAUSE_INVALID_NUMBER_FORMAT = $1C
CAUSE_STATUS_ENQUIRY_RESPONSE = $1E
CAUSE_NORMAL_UNSPECIFIED = $1F
CAUSE_VPI_VCI_UNAVAILABLE = $23
CAUSE_NETWORK_OUT_OF_ORDER = $26
CAUSE_TEMPORARY_FAILURE = $29
CAUSE_ACCESS_INFORMAION_DISCARDED = $2B
CAUSE_NO_VPI_VCI_AVAILABLE = $2D
CAUSE_RESOURCE_UNAVAILABLE = $2F
CAUSE_QOS_UNAVAILABLE = $31
CAUSE_USER_CELL_RATE_UNAVAILABLE = $33
CAUSE_BEARER_CAPABILITY_UNAUTHORIZED = $39
CAUSE_BEARER_CAPABILITY_UNAVAILABLE = $3A
CAUSE_OPTION_UNAVAILABLE = $3F
CAUSE_BEARER_CAPABILITY_UNIMPLEMENTED = $41
CAUSE_UNSUPPORTED_TRAFFIC_PARAMETERS = $49
CAUSE_INVALID_CALL_REFERENCE = $51
CAUSE_CHANNEL_NONEXISTENT = $52
CAUSE_INCOMPATIBLE_DESTINATION = $58
CAUSE_INVALID_ENDPOINT_REFERENCE = $59
CAUSE_INVALID_TRANSIT_NETWORK_SELECTION = $5B
CAUSE_TOO_MANY_PENDING_ADD_PARTY = $5C
CAUSE_AAL_PARAMETERS_UNSUPPORTED = $5D
CAUSE_MANDATORY_IE_MISSING = $60
CAUSE_UNIMPLEMENTED_MESSAGE_TYPE = $61
CAUSE_UNIMPLEMENTED_IE = $63
CAUSE_INVALID_IE_CONTENTS = $64
CAUSE_INVALID_STATE_FOR_MESSAGE = $65
CAUSE_RECOVERY_ON_TIMEOUT = $66
CAUSE_INCORRECT_MESSAGE_LENGTH = $68
CAUSE_PROTOCOL_ERROR = $6F
CAUSE_COND_UNKNOWN = 0
CAUSE_COND_PERMANENT = 1
CAUSE_COND_TRANSIENT = 2
CAUSE_REASON_USER = 0
CAUSE_REASON_IE_MISSING = 4
CAUSE_REASON_IE_INSUFFICIENT = 8
CAUSE_PU_PROVIDER = 0
CAUSE_PU_USER = 8
CAUSE_NA_NORMAL = 0
CAUSE_NA_ABNORMAL = 4

struct ATMCAUSEIE
       Location db ?
       Cause db ?
       DiagnosticsLength db ?
       Diagnostics db 4 dup(?)
ends

QOS_CLASS0 = 0
QOS_CLASS1 = 1
QOS_CLASS2 = 2
QOS_CLASS3 = 3
QOS_CLASS4 = 4

struct ATMQOSCLASSIE
       QOSClassForward db ?
       QOSClassBackward db ?
ends

TNS_TYPE_NATIONAL = $40
TNS_PLAN_CARRIER_ID_CODE = 1

struct ATMTRANSITNETWORKSELECTIONIE
       TypeOfNetworkId db ?
       NetworkIdPlan db ?
       NetworkIdLength db ?
       NetworkId db ?
ends

SIO_GET_NUMBER_OF_ATM_DEVICES = $50160001
SIO_GET_ATM_ADDRESS = $d0160002
SIO_ASSOCIATE_PVC = $90160003
SIO_GET_ATM_CONNECTION_ID = $50160004

struct ATMCONNECTIONID
       DeviceNumber dd ?
       VPI dd ?
       VCI dd ?
ends

struct ATMPVCPARAMS
       PvcConnectionId ATMCONNECTIONID
       PvcQos QOS
ends


;FMOD Main header file. Copyright (c), Firelight Technologies Pty, Ltd. 1999-2004.          */
;FMOD Version 3.74
FMOD_VERSION	equ 3.74f

;FMOD_ERRORS
FMOD_ERR_NONE = 0
FMOD_ERR_BUSY = 1
FMOD_ERR_UNINITIALIZED = 2
FMOD_ERR_INIT = 3
FMOD_ERR_ALLOCATED = 4
FMOD_ERR_PLAY = 5
FMOD_ERR_OUTPUT_FORMAT = 6
FMOD_ERR_COOPERATIVELEVEL = 7
FMOD_ERR_CREATEBUFFER = 8
FMOD_ERR_FILE_NOTFOUND = 9
FMOD_ERR_FILE_FORMAT = 10
FMOD_ERR_FILE_BAD = 11
FMOD_ERR_MEMORY = 12
FMOD_ERR_VERSION = 13
FMOD_ERR_INVALID_PARAM = 14
FMOD_ERR_NO_EAX = 15
FMOD_ERR_CHANNEL_ALLOC = 16
FMOD_ERR_RECORD = 17
FMOD_ERR_MEDIAPLAYER = 18
FMOD_ERR_CDDEVICE = 19

;These output types are used with FSOUND_SetOutput, to choose which output driver to use.
FSOUND_OUTPUT_NOSOUND = 0
FSOUND_OUTPUT_WINMM = 1
FSOUND_OUTPUT_DSOUND = 2
FSOUND_OUTPUT_A3D = 3
FSOUND_OUTPUT_OSS = 4
FSOUND_OUTPUT_ESD = 5
FSOUND_OUTPUT_ALSA = 6
FSOUND_OUTPUT_ASIO = 7
FSOUND_OUTPUT_XBOX = 8
FSOUND_OUTPUT_PS2 = 9
FSOUND_OUTPUT_MAC = 10
FSOUND_OUTPUT_GC = 11
FSOUND_OUTPUT_NOSOUND_NONREALTIME = 12

;These mixer types are used with FSOUND_SetMixer, to choose which mixer to use, or to act
;upon for other reasons using FSOUND_GetMixer.
;It is not nescessary to set the mixer.  FMOD will autodetect the best mixer for you.
FSOUND_MIXER_AUTODETECT = 0
FSOUND_MIXER_BLENDMODE = 1
FSOUND_MIXER_MMXP5 = 2
FSOUND_MIXER_MMXP6 = 3
FSOUND_MIXER_QUALITY_AUTODETECT = 4
FSOUND_MIXER_QUALITY_FPU = 5
FSOUND_MIXER_QUALITY_MMXP5 = 6
FSOUND_MIXER_QUALITY_MMXP6 = 7
FSOUND_MIXER_MONO = 8
FSOUND_MIXER_QUALITY_MONO = 9
FSOUND_MIXER_MAX = 10

;These definitions describe the type of song being played.
FMUSIC_TYPE_NONE = 0
FMUSIC_TYPE_MOD = 1
FMUSIC_TYPE_S3M = 2
FMUSIC_TYPE_XM = 3
FMUSIC_TYPE_IT = 4
FMUSIC_TYPE_MIDI = 5
FMUSIC_TYPE_FSB = 6

;These default priorities are used by FMOD internal system DSP units.  They describe the
;position of the DSP chain equ  and the order of how audio processing is executed.
;You can actually through the use of FSOUND_DSP_GetxxxUnit (where xxx is the name of the DSP
;unit), disable or even change the priority of a DSP unit.
FSOUND_DSP_DEFAULTPRIORITY_CLEARUNIT = 0
FSOUND_DSP_DEFAULTPRIORITY_SFXUNIT = 100
FSOUND_DSP_DEFAULTPRIORITY_MUSICUNIT = 200
FSOUND_DSP_DEFAULTPRIORITY_USER = 300
FSOUND_DSP_DEFAULTPRIORITY_FFTUNIT = 900
FSOUND_DSP_DEFAULTPRIORITY_CLIPANDCOPYUNIT = 1000

;Driver description bitfields.  Use FSOUND_Driver_GetCaps to determine if a driver enumerated
;has the settings you are after.  The enumerated driver depends on the output mode, see
FSOUND_CAPS_HARDWARE = 1
FSOUND_CAPS_EAX2 = 2
FSOUND_CAPS_EAX3 = $10

;Sample description bitfields, OR them together for loading and describing samples.
;NOTE.  If the file format being loaded already has a defined format, such as WAV or MP3, then
;trying to override the pre-defined format with a new set of format flags will not work.  For
;example, an 8 bit WAV file will not load as 16bit if you specify FSOUND_16BITS.  It will just
;ignore the flag and go ahead loading it as 8bits.  For these type of formats the only flags
;you can specify that will really alter the behaviour of how it is loaded, are the following.
FSOUND_LOOP_OFF = 1
FSOUND_LOOP_NORMAL = 2
FSOUND_LOOP_BIDI = 4
FSOUND_8BITS = 8
FSOUND_16BITS = $10
FSOUND_MONO = $20
FSOUND_STEREO = $40
FSOUND_UNSIGNED = $80
FSOUND_SIGNED = $100
FSOUND_DELTA = $200
FSOUND_IT214 = $400
FSOUND_IT215 = $800
FSOUND_HW3D = $1000
FSOUND_2D = $2000
FSOUND_STREAMABLE = $4000
FSOUND_LOADMEMORY = $8000
FSOUND_LOADRAW = $10000
FSOUND_MPEGACCURATE = $20000
FSOUND_FORCEMONO = $40000
FSOUND_HW2D = $80000
FSOUND_ENABLEFX = $100000
FSOUND_MPEGHALFRATE = $200000
FSOUND_IMAADPCM = $400000
FSOUND_VAG = $800000
FSOUND_NONBLOCKING = $1000000
FSOUND_GCADPCM = $2000000
FSOUND_MULTICHANNEL = $4000000
FSOUND_USECORE0 = $8000000
FSOUND_USECORE1 = $10000000
FSOUND_LOADMEMORYIOP = $20000000
FSOUND_IGNORETAGS = $40000000
FSOUND_STREAM_NET = $80000000
FSOUND_NORMAL = FSOUND_16BITS or FSOUND_SIGNED or FSOUND_MONO

;Playback method for a CD Audio track, with FSOUND_CD_SetPlayMode
FSOUND_CD_PLAYCONTINUOUS = 0
FSOUND_CD_PLAYONCE = 1
FSOUND_CD_PLAYLOOPED = 2
FSOUND_CD_PLAYRANDOM = 3

;Miscellaneous values for FMOD functions.
FSOUND_FREE = -1
FSOUND_UNMANAGED = -2
FSOUND_ALL = -3
FSOUND_STEREOPAN = -1
FSOUND_SYSTEMCHANNEL = -1000
FSOUND_SYSTEMSAMPLE = -1000

;Structure defining a reverb environment.
;For more indepth descriptions of the reverb properties under win32, please see the EAX2 and EAX3
;documentation at http://developer.creative.com/ under the 'downloads' section.
;If they do not have the EAX3 documentation, then most information can be attained from
;the EAX2 documentation, as EAX3 only adds some more parameters and functionality on top of EAX2.
;Note the default reverb properties are the same as the FSOUND_PRESET_GENERIC preset.
;Note that integer values that typically range from -10,000 to 1000 are represented in decibels, and are of a logarithmic scale, not linear, wheras float values are typically linear.
;PORTABILITY: Each member has the platform it supports in braces ie (win32/xbox).
;Some reverb parameters are only supported in win32 and some only on xbox. If all parameters are set then the reverb should product a similar effect on either platform.
;The numerical values listed below are the maximum, minimum and default values for each variable respectively.
struct FSOUNDREVERBPROPERTIES
       Environment dd ?
       EnvSize dd ?
       EnvDiffusion dd ?
       Room dd ?
       RoomHF dd ?
       RoomLF dd ?
       DecayTime dd ?
       DecayHFRatio dd ?
       DecayLFRatio dd ?
       Reflections dd ?
       ReflectionsDelay dd ?
       ReflectionsPan dd 3 dup(?)
       Reverb dd ?
       ReverbDelay dd ?
       ReverbPan: times dd 3 dup(?)
       EchoTime dd ?
       EchoDepth dd ?
       ModulationTime dd ?
       ModulationDepth dd ?
       AirAbsorptionHF dd ?
       HFReference dd ?
       LFReference dd ?
       RoomRolloffFactor dd ?
       Diffusion dd ?
       Density dd ?
       Flags dd ?
ends

;Values for the Flags member of the FSOUND_REVERB_PROPERTIES structure.
FSOUND_REVERB_FLAGS_DECAYTIMESCALE = 1
FSOUND_REVERB_FLAGS_REFLECTIONSSCALE = 2
FSOUND_REVERB_FLAGS_REFLECTIONSDELAYSCALE = 4
FSOUND_REVERB_FLAGS_REVERBSCALE = 8
FSOUND_REVERB_FLAGS_REVERBDELAYSCALE = $10
FSOUND_REVERB_FLAGS_DECAYHFLIMIT = $20
FSOUND_REVERB_FLAGS_ECHOTIMESCALE = $40
FSOUND_REVERB_FLAGS_MODULATIONTIMESCALE = $80
FSOUND_REVERB_FLAGS_CORE0 = $100
FSOUND_REVERB_FLAGS_CORE1 = $200
FSOUND_REVERB_FLAGS_DEFAULT = FSOUND_REVERB_FLAGS_DECAYTIMESCALE or \
			      FSOUND_REVERB_FLAGS_REFLECTIONSSCALE or \
			      FSOUND_REVERB_FLAGS_REFLECTIONSDELAYSCALE or \
			      FSOUND_REVERB_FLAGS_REVERBSCALE or \
			      FSOUND_REVERB_FLAGS_REVERBDELAYSCALE or \
			      FSOUND_REVERB_FLAGS_DECAYHFLIMIT or \
			      FSOUND_REVERB_FLAGS_CORE0 or \
			      FSOUND_REVERB_FLAGS_CORE1

;FSOUND_REVERB_PROPERTIES prop = FSOUND_PRESET_GENERIC;
;                               Env      Size    Diffus  Room   RoomHF  RmLF DecTm   DecHF  DecLF   Refl  RefDel  RefPan               Revb  RevDel  ReverbPan           EchoTm  EchDp  ModTm  ModDp  AirAbs  HFRef    LFRef  RRlOff Diffus  Densty  FLAGS */
;FSOUND_PRESET_OFF              {0,      7.5f,   1.00f, -10000, -10000, 0,   1.00f,  1.00f, 1.0f,  -2602, 0.007f, { 0.0f,0.0f,0.0f },   200, 0.011f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f,   0.0f,   0.0f, 0x33f }
;FSOUND_PRESET_GENERIC          {0,      7.5f,   1.00f, -1000,  -100,   0,   1.49f,  0.83f, 1.0f,  -2602, 0.007f, { 0.0f,0.0f,0.0f },   200, 0.011f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f }
;FSOUND_PRESET_PADDEDCELL       {1,      1.4f,   1.00f, -1000,  -6000,  0,   0.17f,  0.10f, 1.0f,  -1204, 0.001f, { 0.0f,0.0f,0.0f },   207, 0.002f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f }
;FSOUND_PRESET_ROOM             {2,      1.9f,   1.00f, -1000,  -454,   0,   0.40f,  0.83f, 1.0f,  -1646, 0.002f, { 0.0f,0.0f,0.0f },    53, 0.003f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f }
;FSOUND_PRESET_BATHROOM         {3,      1.4f,   1.00f, -1000,  -1200,  0,   1.49f,  0.54f, 1.0f,   -370, 0.007f, { 0.0f,0.0f,0.0f },  1030, 0.011f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f,  60.0f, 0x3f }
;FSOUND_PRESET_LIVINGROOM       {4,      2.5f,   1.00f, -1000,  -6000,  0,   0.50f,  0.10f, 1.0f,  -1376, 0.003f, { 0.0f,0.0f,0.0f }, -1104, 0.004f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f }
;FSOUND_PRESET_STONEROOM        {5,      11.6f,  1.00f, -1000,  -300,   0,   2.31f,  0.64f, 1.0f,   -711, 0.012f, { 0.0f,0.0f,0.0f },    83, 0.017f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f }
;FSOUND_PRESET_AUDITORIUM       {6,      21.6f,  1.00f, -1000,  -476,   0,   4.32f,  0.59f, 1.0f,   -789, 0.020f, { 0.0f,0.0f,0.0f },  -289, 0.030f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f }
;FSOUND_PRESET_CONCERTHALL      {7,      19.6f,  1.00f, -1000,  -500,   0,   3.92f,  0.70f, 1.0f,  -1230, 0.020f, { 0.0f,0.0f,0.0f },    -2, 0.029f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f }
;FSOUND_PRESET_CAVE             {8,      14.6f,  1.00f, -1000,  0,      0,   2.91f,  1.30f, 1.0f,   -602, 0.015f, { 0.0f,0.0f,0.0f },  -302, 0.022f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x1f }
;FSOUND_PRESET_ARENA            {9,      36.2f,  1.00f, -1000,  -698,   0,   7.24f,  0.33f, 1.0f,  -1166, 0.020f, { 0.0f,0.0f,0.0f },    16, 0.030f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f }
;FSOUND_PRESET_HANGAR           {10,     50.3f,  1.00f, -1000,  -1000,  0,   10.05f, 0.23f, 1.0f,   -602, 0.020f, { 0.0f,0.0f,0.0f },   198, 0.030f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f }
;FSOUND_PRESET_CARPETTEDHALLWAY {11,     1.9f,   1.00f, -1000,  -4000,  0,   0.30f,  0.10f, 1.0f,  -1831, 0.002f, { 0.0f,0.0f,0.0f }, -1630, 0.030f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f }
;FSOUND_PRESET_HALLWAY          {12,     1.8f,   1.00f, -1000,  -300,   0,   1.49f,  0.59f, 1.0f,  -1219, 0.007f, { 0.0f,0.0f,0.0f },   441, 0.011f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f }
;FSOUND_PRESET_STONECORRIDOR    {13,     13.5f,  1.00f, -1000,  -237,   0,   2.70f,  0.79f, 1.0f,  -1214, 0.013f, { 0.0f,0.0f,0.0f },   395, 0.020f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f }
;FSOUND_PRESET_ALLEY            {14,     7.5f,   0.30f, -1000,  -270,   0,   1.49f,  0.86f, 1.0f,  -1204, 0.007f, { 0.0f,0.0f,0.0f },    -4, 0.011f, { 0.0f,0.0f,0.0f }, 0.125f, 0.95f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f }
;FSOUND_PRESET_FOREST           {15,     38.0f,  0.30f, -1000,  -3300,  0,   1.49f,  0.54f, 1.0f,  -2560, 0.162f, { 0.0f,0.0f,0.0f },  -229, 0.088f, { 0.0f,0.0f,0.0f }, 0.125f, 1.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f,  79.0f, 100.0f, 0x3f }
;FSOUND_PRESET_CITY             {16,     7.5f,   0.50f, -1000,  -800,   0,   1.49f,  0.67f, 1.0f,  -2273, 0.007f, { 0.0f,0.0f,0.0f }, -1691, 0.011f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f,  50.0f, 100.0f, 0x3f }
;FSOUND_PRESET_MOUNTAINS        {17,     100.0f, 0.27f, -1000,  -2500,  0,   1.49f,  0.21f, 1.0f,  -2780, 0.300f, { 0.0f,0.0f,0.0f }, -1434, 0.100f, { 0.0f,0.0f,0.0f }, 0.250f, 1.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f,  27.0f, 100.0f, 0x1f }
;FSOUND_PRESET_QUARRY           {18,     17.5f,  1.00f, -1000,  -1000,  0,   1.49f,  0.83f, 1.0f, -10000, 0.061f, { 0.0f,0.0f,0.0f },   500, 0.025f, { 0.0f,0.0f,0.0f }, 0.125f, 0.70f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f }
;FSOUND_PRESET_PLAIN            {19,     42.5f,  0.21f, -1000,  -2000,  0,   1.49f,  0.50f, 1.0f,  -2466, 0.179f, { 0.0f,0.0f,0.0f }, -1926, 0.100f, { 0.0f,0.0f,0.0f }, 0.250f, 1.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f,  21.0f, 100.0f, 0x3f }
;FSOUND_PRESET_PARKINGLOT       {20,     8.3f,   1.00f, -1000,  0,      0,   1.65f,  1.50f, 1.0f,  -1363, 0.008f, { 0.0f,0.0f,0.0f }, -1153, 0.012f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x1f }
;FSOUND_PRESET_SEWERPIPE        {21,     1.7f,   0.80f, -1000,  -1000,  0,   2.81f,  0.14f, 1.0f,    429, 0.014f, { 0.0f,0.0f,0.0f },  1023, 0.021f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f,  80.0f,  60.0f, 0x3f }
;FSOUND_PRESET_UNDERWATER       {22,     1.8f,   1.00f, -1000,  -4000,  0,   1.49f,  0.10f, 1.0f,   -449, 0.007f, { 0.0f,0.0f,0.0f },  1700, 0.011f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 1.18f, 0.348f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f }

;/* Non I3DL2 presets */
;FSOUND_PRESET_DRUGGED          {23,     1.9f,   0.50f, -1000,  0,      0,   8.39f,  1.39f, 1.0f,  -115,  0.002f, { 0.0f,0.0f,0.0f },   985, 0.030f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 1.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x1f }
;FSOUND_PRESET_DIZZY            {24,     1.8f,   0.60f, -1000,  -400,   0,   17.23f, 0.56f, 1.0f,  -1713, 0.020f, { 0.0f,0.0f,0.0f },  -613, 0.030f, { 0.0f,0.0f,0.0f }, 0.250f, 1.00f, 0.81f, 0.310f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x1f }
;FSOUND_PRESET_PSYCHOTIC        {25,     1.0f,   0.50f, -1000,  -151,   0,   7.56f,  0.91f, 1.0f,  -626,  0.020f, { 0.0f,0.0f,0.0f },   774, 0.030f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 4.00f, 1.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x1f }

;/* PlayStation 2 Only presets */
;FSOUND_PRESET_PS2_ROOM         {1,      0,          0,         0,  0,      0,   0.0f,   0.0f,  0.0f,     0,  0.000f, { 0.0f,0.0f,0.0f },     0, 0.000f, { 0.0f,0.0f,0.0f }, 0.000f, 0.00f, 0.00f, 0.000f,  0.0f, 0000.0f,   0.0f, 0.0f,   0.0f,   0.0f, 0x31f }
;FSOUND_PRESET_PS2_STUDIO_A     {2,      0,          0,         0,  0,      0,   0.0f,   0.0f,  0.0f,     0,  0.000f, { 0.0f,0.0f,0.0f },     0, 0.000f, { 0.0f,0.0f,0.0f }, 0.000f, 0.00f, 0.00f, 0.000f,  0.0f, 0000.0f,   0.0f, 0.0f,   0.0f,   0.0f, 0x31f }
;FSOUND_PRESET_PS2_STUDIO_B     {3,      0,          0,         0,  0,      0,   0.0f,   0.0f,  0.0f,     0,  0.000f, { 0.0f,0.0f,0.0f },     0, 0.000f, { 0.0f,0.0f,0.0f }, 0.000f, 0.00f, 0.00f, 0.000f,  0.0f, 0000.0f,   0.0f, 0.0f,   0.0f,   0.0f, 0x31f }
;FSOUND_PRESET_PS2_STUDIO_C     {4,      0,          0,         0,  0,      0,   0.0f,   0.0f,  0.0f,     0,  0.000f, { 0.0f,0.0f,0.0f },     0, 0.000f, { 0.0f,0.0f,0.0f }, 0.000f, 0.00f, 0.00f, 0.000f,  0.0f, 0000.0f,   0.0f, 0.0f,   0.0f,   0.0f, 0x31f }
;FSOUND_PRESET_PS2_HALL         {5,      0,          0,         0,  0,      0,   0.0f,   0.0f,  0.0f,     0,  0.000f, { 0.0f,0.0f,0.0f },     0, 0.000f, { 0.0f,0.0f,0.0f }, 0.000f, 0.00f, 0.00f, 0.000f,  0.0f, 0000.0f,   0.0f, 0.0f,   0.0f,   0.0f, 0x31f }
;FSOUND_PRESET_PS2_SPACE        {6,      0,          0,         0,  0,      0,   0.0f,   0.0f,  0.0f,     0,  0.000f, { 0.0f,0.0f,0.0f },     0, 0.000f, { 0.0f,0.0f,0.0f }, 0.000f, 0.00f, 0.00f, 0.000f,  0.0f, 0000.0f,   0.0f, 0.0f,   0.0f,   0.0f, 0x31f }
;FSOUND_PRESET_PS2_ECHO         {7,      0,          0,         0,  0,      0,   0.0f,   0.0f,  0.0f,     0,  0.000f, { 0.0f,0.0f,0.0f },     0, 0.000f, { 0.0f,0.0f,0.0f }, 0.000f, 0.00f, 0.00f, 0.000f,  0.0f, 0000.0f,   0.0f, 0.0f,   0.0f,   0.0f, 0x31f }
;FSOUND_PRESET_PS2_DELAY        {8,      0,          0,         0,  0,      0,   0.0f,   0.0f,  0.0f,     0,  0.000f, { 0.0f,0.0f,0.0f },     0, 0.000f, { 0.0f,0.0f,0.0f }, 0.000f, 0.00f, 0.00f, 0.000f,  0.0f, 0000.0f,   0.0f, 0.0f,   0.0f,   0.0f, 0x31f }
;FSOUND_PRESET_PS2_PIPE         {9,      0,          0,         0,  0,      0,   0.0f,   0.0f,  0.0f,     0,  0.000f, { 0.0f,0.0f,0.0f },     0, 0.000f, { 0.0f,0.0f,0.0f }, 0.000f, 0.00f, 0.00f, 0.000f,  0.0f, 0000.0f,   0.0f, 0.0f,   0.0f,   0.0f, 0x31f }

struct FSOUNDREVERBCHANNELPROPERTIES
       Direct dd ?
       DirectHF dd ?
       Room dd ?
       RoomHF dd ?
       Obstruction dd ?
       ObstructionLFRatio dd ?
       Occlusion dd ?
       OcclusionLFRatio dd ?
       OcclusionRoomRatio dd ?
       OcclusionDirectRatio dd ?
       Exclusion dd ?
       ExclusionLFRatio dd ?
       OutsideVolumeHF dd ?
       DopplerFactor dd ?
       RolloffFactor dd ?
       RoomRolloffFactor dd ?
       AirAbsorptionFactor dd ?
       Flags dd ?
ends


;Values for the Flags member of the FSOUND_REVERB_CHANNELPROPERTIES structure.
FSOUND_REVERB_CHANNELFLAGS_DIRECTHFAUTO = 1
FSOUND_REVERB_CHANNELFLAGS_ROOMAUTO = 2
FSOUND_REVERB_CHANNELFLAGS_ROOMHFAUTO = 4
FSOUND_REVERB_CHANNELFLAGS_DEFAULT = FSOUND_REVERB_CHANNELFLAGS_DIRECTHFAUTO or \
				     FSOUND_REVERB_CHANNELFLAGS_ROOMAUTO or \
				     FSOUND_REVERB_CHANNELFLAGS_ROOMHFAUTO

;These values are used with FSOUND_FX_Enable to enable DirectX 8 FX for a channel.
FSOUND_FX_Enable = 0
FSOUND_FX_Disable = 1
FSOUND_FX_SetChorus = 2
FSOUND_FX_SetCompressor = 3
FSOUND_FX_SetDistortion = 4
FSOUND_FX_SetEcho = 5
FSOUND_FX_SetFlanger = 6
FSOUND_FX_SetGargle = 7
FSOUND_FX_SetI3DL2Reverb = 8
FSOUND_FX_SetParamEQ = 9
FSOUND_FX_SetWavesReverb = 10

FSOUND_FX_CHORUS = 0
FSOUND_FX_COMPRESSOR = 1
FSOUND_FX_DISTORTION = 2
FSOUND_FX_ECHO = 3
FSOUND_FX_FLANGER = 4
FSOUND_FX_GARGLE = 5
FSOUND_FX_I3DL2REVERB = 6
FSOUND_FX_PARAMEQ = 7
FSOUND_FX_WAVES_REVERB = 8
FSOUND_FX_MAX = 9

;These are speaker types defined for use with the FSOUND_SetSpeakerMode command.
;Note - Only reliably works with FSOUND_OUTPUT_DSOUND or FSOUND_OUTPUT_XBOX output modes.  Other output modes will only
;interpret FSOUND_SPEAKERMODE_MONO and set everything else to be stereo.
;Using either DolbyDigital or DTS will use whatever 5.1 digital mode is available if destination hardware is unsure.
FSOUND_SPEAKERMODE_DOLBYDIGITAL = 0
FSOUND_SPEAKERMODE_HEADPHONES = 1
FSOUND_SPEAKERMODE_MONO = 2
FSOUND_SPEAKERMODE_QUAD = 3
FSOUND_SPEAKERMODE_STEREO = 4
FSOUND_SPEAKERMODE_SURROUND = 5
FSOUND_SPEAKERMODE_DTS = 6
FSOUND_SPEAKERMODE_PROLOGIC2 = 7
FSOUND_SPEAKERMODE_PROLOGIC2_INTERIOR = 8

;Initialization flags.  Use them with FSOUND_Init in the flags parameter to change various behaviour.
;FSOUND_INIT_ENABLESYSTEMCHANNELFX Is an init mode which enables the FSOUND mixer buffer to be affected by DirectX 8 effects.
;Note that due to limitations of DirectSound, FSOUND_Init may fail if this is enabled because the buffersize is too small.
;This can be fixed with FSOUND_SetBufferSize.  Increase the BufferSize until it works.
;When it is enabled you can use the FSOUND_FX api, and use FSOUND_SYSTEMCHANNEL as the channel id when setting parameters.
FSOUND_INIT_USEDEFAULTMIDISYNTH = 1
FSOUND_INIT_GLOBALFOCUS = 2
FSOUND_INIT_ENABLESYSTEMCHANNELFX = 4
FSOUND_INIT_ACCURATEVULEVELS = 8
FSOUND_INIT_PS2_DISABLECORE0REVERB = $10
FSOUND_INIT_PS2_DISABLECORE1REVERB = $20
FSOUND_INIT_PS2_SWAPDMACORES = $40
FSOUND_INIT_DONTLATENCYADJUST = $80
FSOUND_INIT_GC_INITLIBS = $100
FSOUND_INIT_STREAM_FROM_MAIN_THREAD = $200
FSOUND_INIT_PS2_USEVOLUMERAMPING = $400
FSOUND_INIT_DSOUND_DEFERRED = $800
FSOUND_INIT_DSOUND_HRTF_LIGHT = $1000
FSOUND_INIT_DSOUND_HRTF_FULL = $2000

;Status values for internet streams. Use FSOUND_Stream_Net_GetStatus to get the current status of an internet stream.
FSOUND_STREAM_NET_NOTCONNECTED = 0
FSOUND_STREAM_NET_CONNECTING = 1
FSOUND_STREAM_NET_BUFFERING = 2
FSOUND_STREAM_NET_READY = 3
FSOUND_STREAM_NET_ERROR = 4

;Describes the type of a particular tag field.
FSOUND_TAGFIELD_VORBISCOMMENT = 0
FSOUND_TAGFIELD_ID3V1 = 1
FSOUND_TAGFIELD_ID3V2 = 2
FSOUND_TAGFIELD_SHOUTCAST = 3
FSOUND_TAGFIELD_ICECAST = 4
FSOUND_TAGFIELD_ASF = 5

;These values describe the protocol and format of an internet stream. Use FSOUND_Stream_Net_GetStatus to retrieve this information for an open internet stream.
FSOUND_PROTOCOL_SHOUTCAST = 1
FSOUND_PROTOCOL_ICECAST = 2
FSOUND_PROTOCOL_HTTP = 4
FSOUND_FORMAT_MPEG = $10000
FSOUND_FORMAT_OGGVORBIS = $20000

;Structure defining a CD table of contents. This structure is returned as a tag from FSOUND_Stream_FindTagField when the tag name "CD_TOC" is specified.
;Note: All tracks on the CD - including data tracks- will be represented in this structure so it's use for anything other than generating disc id information is not recommended.
;See the cdda example program for info on retrieving and using this structure.
struct FSOUNDTOC
       name rb 4
       numtracks dd ?
       min dd 100 dup(?)
       sec rd 100
       frame rd 100
ends


;mmsystem.h -- Include file for Multimedia API's
;Version 4.00
;Copyright (C) 1992-1998 Microsoft Corporation.  All Rights Reserved.
;?? msvideo.h  msacm.h  vfw.h

MAXPNAMELEN = 32
MAXERRORLENGTH = 256
MAX_JOYSTICKOEMVXDNAME = 260

MM_MICROSOFT = 1

MM_MIDI_MAPPER = 1
MM_WAVE_MAPPER = 2
MM_SNDBLST_MIDIOUT = 3
MM_SNDBLST_MIDIIN = 4
MM_SNDBLST_SYNTH = 5
MM_SNDBLST_WAVEOUT = 6
MM_SNDBLST_WAVEIN = 7
MM_ADLIB = 9
MM_MPU401_MIDIOUT = 10
MM_MPU401_MIDIIN = 11
MM_PC_JOYSTICK = 12

struct MMTIME
       wType dd ?
       union
           ms dd ?
           sample dd ?
           cb dd ?
           ticks dd ?
           struct
               hour db ?
               min db ?
               sec db ?
               frame db ?
               fps db ?
               dummy db ?
               pad  db ?,?
           ends
           struct
               songptrpos dd ?
           ends
       ends
ends

TIME_MS = 1
TIME_SAMPLES = 2
TIME_BYTES = 4
TIME_SMPTE = 8
TIME_MIDI = $10
TIME_TICKS = $20

MM_JOY1MOVE = $3A0
MM_JOY2MOVE = $3A1
MM_JOY1ZMOVE = $3A2
MM_JOY2ZMOVE = $3A3
MM_JOY1BUTTONDOWN = $3B5
MM_JOY2BUTTONDOWN = $3B6
MM_JOY1BUTTONUP = $3B7
MM_JOY2BUTTONUP = $3B8
MM_MCINOTIFY = $3B9
MM_WOM_OPEN = $3BB
MM_WOM_CLOSE = $3BC
MM_WOM_DONE = $3BD
MM_WIM_OPEN = $3BE
MM_WIM_CLOSE = $3BF
MM_WIM_DATA = $3C0
MM_MIM_OPEN = $3C1
MM_MIM_CLOSE = $3C2
MM_MIM_DATA = $3C3
MM_MIM_LONGDATA = $3C4
MM_MIM_ERROR = $3C5
MM_MIM_LONGERROR = $3C6
MM_MOM_OPEN = $3C7
MM_MOM_CLOSE = $3C8
MM_MOM_DONE = $3C9
MM_DRVM_OPEN = $3D0
MM_DRVM_CLOSE = $3D1
MM_DRVM_DATA = $3D2
MM_DRVM_ERROR = $3D3
MM_STREAM_OPEN = $3D4
MM_STREAM_CLOSE = $3D5
MM_STREAM_DONE = $3D6
MM_STREAM_ERROR = $3D7
MM_MOM_POSITIONCB = $3CA
MM_MCISIGNAL = $3CB
MM_MIM_MOREDATA = $3CC
MM_MIXM_LINE_CHANGE = $3D0
MM_MIXM_CONTROL_CHANGE = $3D1

MMSYSERR_BASE = 0
WAVERR_BASE = 32
MIDIERR_BASE = 64
TIMERR_BASE = 96
JOYERR_BASE = 160
MCIERR_BASE = 256
MIXERR_BASE = 1024

MCI_STRING_OFFSET = 512
MCI_VD_OFFSET = 1024
MCI_CD_OFFSET = 1088
MCI_WAVE_OFFSET = 1152
MCI_SEQ_OFFSET = 1216

MMSYSERR_NOERROR = 0
MMSYSERR_ERROR = (MMSYSERR_BASE + 1)
MMSYSERR_BADDEVICEID = (MMSYSERR_BASE + 2)
MMSYSERR_NOTENABLED = (MMSYSERR_BASE + 3)
MMSYSERR_ALLOCATED = (MMSYSERR_BASE + 4)
MMSYSERR_INVALHANDLE = (MMSYSERR_BASE + 5)
MMSYSERR_NODRIVER = (MMSYSERR_BASE + 6)
MMSYSERR_NOMEM = (MMSYSERR_BASE + 7)
MMSYSERR_NOTSUPPORTED = (MMSYSERR_BASE + 8)
MMSYSERR_BADERRNUM = (MMSYSERR_BASE + 9)
MMSYSERR_INVALFLAG = (MMSYSERR_BASE + 10)
MMSYSERR_INVALPARAM = (MMSYSERR_BASE + 11)
MMSYSERR_HANDLEBUSY = (MMSYSERR_BASE + 12)
MMSYSERR_INVALIDALIAS = (MMSYSERR_BASE + 13)
MMSYSERR_BADDB = (MMSYSERR_BASE + 14)
MMSYSERR_KEYNOTFOUND = (MMSYSERR_BASE + 15)
MMSYSERR_READERROR = (MMSYSERR_BASE + 16)
MMSYSERR_WRITEERROR = (MMSYSERR_BASE + 17)
MMSYSERR_DELETEERROR = (MMSYSERR_BASE + 18)
MMSYSERR_VALNOTFOUND = (MMSYSERR_BASE + 19)
MMSYSERR_NODRIVERCB = (MMSYSERR_BASE + 20)
MMSYSERR_MOREDATA = (MMSYSERR_BASE + 21)
MMSYSERR_LASTERROR = (MMSYSERR_BASE + 21)

struct DRVCONFIGINFOEX
       dwDCISize dd ?
       lpszDCISectionName dq ?
       lpszDCIAliasName dq ?
       dnDevNode dd ?
ends

DRV_LOAD = 1
DRV_ENABLE = 2
DRV_OPEN = 3
DRV_CLOSE = 4
DRV_DISABLE = 5
DRV_FREE = 6
DRV_CONFIGURE = 7
DRV_QUERYCONFIGURE = 8
DRV_INSTALL = 9
DRV_REMOVE = $A
DRV_EXITSESSION = $B
DRV_POWER = $F
DRV_RESERVED = $800
DRV_USER = $4000

struct DRVCONFIGINFO
       dwDCISize dd ?
       lpszDCISectionName dq ?
       lpszDCIAliasName dq ?
ends

DRVCNF_CANCEL = 0
DRVCNF_OK = 1
DRVCNF_RESTART = 2

DRV_CANCEL = DRVCNF_CANCEL
DRV_OK = DRVCNF_OK
DRV_RESTART = DRVCNF_RESTART
DRV_MCI_FIRST = DRV_RESERVED
DRV_MCI_LAST = (DRV_RESERVED + $FFF)

CALLBACK_TYPEMASK = $70000
CALLBACK_NULL = 0
CALLBACK_WINDOW = $10000
CALLBACK_TASK = $20000
CALLBACK_FUNCTION = $30000
CALLBACK_THREAD = (CALLBACK_TASK)
CALLBACK_EVENT = $50000

SND_SYNC = 0
SND_ASYNC = 1
SND_NODEFAULT = 2
SND_MEMORY = 4
SND_LOOP = 8
SND_NOSTOP = $10
SND_NOWAIT = $2000
SND_ALIAS = $10000
SND_ALIAS_ID = $110000
SND_FILENAME = $20000
SND_RESOURCE = $40004
SND_PURGE = $40
SND_APPLICATION = $80
SND_SENTRY = $80000
SND_SYSTEM = $200000
SND_ALIAS_START = 0

;#define sndAlias(ch0, ch1) (SND_ALIAS_START + (DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8))
SND_ALIAS_SYSTEMASTERISK equ 'S*'
SND_ALIAS_SYSTEMQUESTION equ 'S?'
SND_ALIAS_SYSTEMHAND equ 'SH'
SND_ALIAS_SYSTEMEXIT equ 'SE'
SND_ALIAS_SYSTEMSTART equ 'SS'
SND_ALIAS_SYSTEMWELCOME equ 'SW'
SND_ALIAS_SYSTEMEXCLAMATION equ 'S!'
SND_ALIAS_SYSTEMDEFAULT equ 'SD'

WAVERR_BADFORMAT = (WAVERR_BASE + 0)
WAVERR_STILLPLAYING = (WAVERR_BASE + 1)
WAVERR_UNPREPARED = (WAVERR_BASE + 2)
WAVERR_SYNC = (WAVERR_BASE + 3)
WAVERR_LASTERROR = (WAVERR_BASE + 3)

WOM_OPEN = MM_WOM_OPEN
WOM_CLOSE = MM_WOM_CLOSE
WOM_DONE = MM_WOM_DONE
WIM_OPEN = MM_WIM_OPEN
WIM_CLOSE = MM_WIM_CLOSE
WIM_DATA = MM_WIM_DATA

WAVE_MAPPER = -1
WAVE_FORMAT_QUERY = 1
WAVE_ALLOWSYNC = 2
WAVE_MAPPED = 4
WAVE_FORMAT_DIRECT = 8
WAVE_FORMAT_DIRECT_QUERY = (WAVE_FORMAT_QUERY + WAVE_FORMAT_DIRECT)

struct WAVEHDR
       lpData dq ?
       dwBufferLength dd ?
       dwBytesRecorded dd ?
       dwUser dq ?
       dwFlags dd ?
       dwLoops dd ?
       lpNext dq ?
       reserved dq ?
ends

WHDR_DONE = 1
WHDR_PREPARED = 2
WHDR_BEGINLOOP = 4
WHDR_ENDLOOP = 8
WHDR_INQUEUE = $10

struct WAVEOUTCAPSA
       wMid dw ?
       wPid dw ?
       vDriverVersion dd ?
       szPname db MAXPNAMELEN dup(?)
       dwFormats dd ?
       wChannels dw ?
       wReserved1 dw ?
       dwSupport dd ?
ends

struct WAVEOUTCAPSW
       wMid dw ?
       wPid dw ?
       vDriverVersion dd ?
       szPname du MAXPNAMELEN dup(?)
       dwFormats dd ?
       wChannels dw ?
       wReserved1 dw ?
       dwSupport dd ?
ends

struct WAVEOUTCAPS2A
       wMid dw ?
       wPid dw ?
       vDriverVersion dd ?
       szPname db MAXPNAMELEN dup(?)
       dwFormats dd ?
       wChannels dw ?
       wReserved1 dw ?
       dwSupport dd ?
       ManufacturerGuid GUID
       ProductGuid GUID
       NameGuid GUID
ends

struct WAVEOUTCAPS2W
       wMid dw ?
       wPid dw ?
       vDriverVersion dd ?
       szPname du MAXPNAMELEN dup(?)
       dwFormats dd ?
       wChannels dw ?
       wReserved1 dw ?
       dwSupport dd ?
       ManufacturerGuid GUID
       ProductGuid GUID
       NameGuid GUID
ends

WAVECAPS_PITCH = 1
WAVECAPS_PLAYBACKRATE = 2
WAVECAPS_VOLUME = 4
WAVECAPS_LRVOLUME = 8
WAVECAPS_SYNC = $10
WAVECAPS_SAMPLEACCURATE = $20

struct WAVEINCAPSA
       wMid dw ?
       wPid dw ?
       vDriverVersion dd ?
       szPname db MAXPNAMELEN dup(?)
       dwFormats dd ?
       wChannels dw ?
       wReserved1 dw ?
ends

struct WAVEINCAPSW
       wMid dw ?
       wPid dw ?
       vDriverVersion dd ?
       szPname du MAXPNAMELEN dup(?)
       dwFormats dd ?
       wChannels dw ?
       wReserved1 dw ?
ends

struct WAVEINCAPS2A
       wMid dw ?
       wPid dw ?
       vDriverVersion dd ?
       szPname db MAXPNAMELEN dup(?)
       dwFormats dd ?
       wChannels dw ?
       wReserved1 dw ?
       ManufacturerGuid GUID
       ProductGuid GUID
       NameGuid GUID
ends

struct WAVEINCAPS2W
       wMid dw ?
       wPid dw ?
       vDriverVersion dd ?
       szPname du MAXPNAMELEN dup(?)
       dwFormats dd ?
       wChannels dw ?
       wReserved1 dw ?
       ManufacturerGuid GUID
       ProductGuid GUID
       NameGuid GUID
ends

WAVE_INVALIDFORMAT = 0
WAVE_FORMAT_1M08 = 1
WAVE_FORMAT_1S08 = 2
WAVE_FORMAT_1M16 = 4
WAVE_FORMAT_1S16 = 8
WAVE_FORMAT_2M08 = $10
WAVE_FORMAT_2S08 = $20
WAVE_FORMAT_2M16 = $40
WAVE_FORMAT_2S16 = $80
WAVE_FORMAT_4M08 = $100
WAVE_FORMAT_4S08 = $200
WAVE_FORMAT_4M16 = $400
WAVE_FORMAT_4S16 = $800

WAVE_FORMAT_44M08 = $100
WAVE_FORMAT_44S08 = $200
WAVE_FORMAT_44M16 = $400
WAVE_FORMAT_44S16 = $800
WAVE_FORMAT_48M08 = $1000
WAVE_FORMAT_48S08 = $2000
WAVE_FORMAT_48M16 = $4000
WAVE_FORMAT_48S16 = $8000
WAVE_FORMAT_96M08 = $10000
WAVE_FORMAT_96S08 = $20000
WAVE_FORMAT_96M16 = $40000
WAVE_FORMAT_96S16 = $80000

struct WAVEFORMAT
       wFormatTag dw ?
       nChannels dw ?
       nSamplesPerSec dd ?
       nAvgBytesPerSec dd ?
       nBlockAlign dw ?
ends

WAVE_FORMAT_PCM = 1

struct PCMWAVEFORMAT
       wf WAVEFORMAT
       wBitsPerSample dw ?
ends

struct WAVEFORMATEX
       wFormatTag dw ?
       nChannels dw ?
       nSamplesPerSec dd ?
       nAvgBytesPerSec dd ?
       nBlockAlign dw ?
       wBitsPerSample dw ?
       cbSize dw ?
ends

MIDIERR_UNPREPARED = (MIDIERR_BASE + 0)
MIDIERR_STILLPLAYING = (MIDIERR_BASE + 1)
MIDIERR_NOMAP = (MIDIERR_BASE + 2)
MIDIERR_NOTREADY = (MIDIERR_BASE + 3)
MIDIERR_NODEVICE = (MIDIERR_BASE + 4)
MIDIERR_INVALIDSETUP = (MIDIERR_BASE + 5)
MIDIERR_BADOPENMODE = (MIDIERR_BASE + 6)
MIDIERR_DONT_CONTINUE = (MIDIERR_BASE + 7)
MIDIERR_LASTERROR = (MIDIERR_BASE + 7)

MIM_OPEN = MM_MIM_OPEN
MIM_CLOSE = MM_MIM_CLOSE
MIM_DATA = MM_MIM_DATA
MIM_LONGDATA = MM_MIM_LONGDATA
MIM_ERROR = MM_MIM_ERROR
MIM_LONGERROR = MM_MIM_LONGERROR
MOM_OPEN = MM_MOM_OPEN
MOM_CLOSE = MM_MOM_CLOSE
MOM_DONE = MM_MOM_DONE
MIM_MOREDATA = MM_MIM_MOREDATA
MOM_POSITIONCB = MM_MOM_POSITIONCB

MIDIMAPPER = -1
MIDI_MAPPER = -1
MIDI_IO_STATUS = $20
MIDI_CACHE_ALL = 1
MIDI_CACHE_BESTFIT = 2
MIDI_CACHE_QUERY = 3
MIDI_UNCACHE = 4

struct MIDIOUTCAPSA
       wMid dw ?
       wPid dw ?
       vDriverVersion dd ?
       szPname db MAXPNAMELEN dup(?)
       wTechnology dw ?
       wVoices dw ?
       wNotes dw ?
       wChannelMask dw ?
       dwSupport dd ?
ends

struct MIDIOUTCAPSW
       wMid dw ?
       wPid dw ?
       vDriverVersion dd ?
       szPname du MAXPNAMELEN dup(?)
       wTechnology dw ?
       wVoices dw ?
       wNotes dw ?
       wChannelMask dw ?
       dwSupport dd ?
ends

struct MIDIOUTCAPS2A
       wMid dw ?
       wPid dw ?
       vDriverVersion dd ?
       szPname db MAXPNAMELEN dup(?)
       wTechnology dw ?
       wVoices dw ?
       wNotes dw ?
       wChannelMask dw ?
       dwSupport dd ?
       ManufacturerGuid GUID
       ProductGuid GUID
       NameGuid GUID
ends

struct MIDIOUTCAPS2W
       wMid dw ?
       wPid dw ?
       vDriverVersion dd ?
       szPname du MAXPNAMELEN dup(?)
       wTechnology dw ?
       wVoices dw ?
       wNotes dw ?
       wChannelMask dw ?
       dwSupport dd ?
       ManufacturerGuid GUID
       ProductGuid GUID
       NameGuid GUID
ends

struct MIDIOUTCAPS
       wMid dw ?
       wPid dw ?
       vDriverVersion dd ?
       szPname db MAXPNAMELEN dup(?)
       wTechnology dw ?
       wVoices dw ?
       wNotes dw ?
       wChannelMask dw ?
       dwSupport dd ?
ends

MOD_MIDIPORT = 1
MOD_SYNTH = 2
MOD_SQSYNTH = 3
MOD_FMSYNTH = 4
MOD_MAPPER = 5
MOD_WAVETABLE = 6
MOD_SWSYNTH = 7

MIDICAPS_VOLUME = 1
MIDICAPS_LRVOLUME = 2
MIDICAPS_CACHE = 4
MIDICAPS_STREAM = 8

struct MIDIINCAPSA
       wMid dw ?
       wPid dw ?
       vDriverVersion dd ?
       szPname db MAXPNAMELEN dup(?)
       dwSupport dd ?
ends

struct MIDIINCAPSW
       wMid dw ?
       wPid dw ?
       vDriverVersion dd ?
       szPname du MAXPNAMELEN dup(?)
       dwSupport dd ?
ends

struct MIDIINCAPS2A
       wMid dw ?
       wPid dw ?
       vDriverVersion dd ?
       szPname db MAXPNAMELEN dup(?)
       dwSupport dd ?
       ManufacturerGuid GUID
       ProductGuid GUID
       NameGuid GUID
ends

struct MIDIINCAPS2W
       wMid dw ?
       wPid dw ?
       vDriverVersion dd ?
       szPname du MAXPNAMELEN dup(?)
       dwSupport dd ?
       ManufacturerGuid GUID
       ProductGuid GUID
       NameGuid GUID
ends

struct MIDIINCAPS
       wMid dw ?
       wPid dw ?
       vDriverVersion dd ?
       szPname db MAXPNAMELEN dup(?)
       dwSupport dd ?
ends

struct MIDIHDR
       lpData dq ?
       dwBufferLength dd ?
       dwBytesRecorded dd ?
       dwUser dq ?
       dwFlags dd ?,?
       lpNext dq ?
       reserved dq ?
       dwOffset dd ?,?
       dwReserved dq 7 dup(?)
ends

struct MIDIEVENT
       dwDeltaTime dd ?
       dwStreamID dd ?
       dwEvent dd ?
       dwParms dd ?
ends

struct MIDISTRMBUFFVER
       dwVersion dd ?
       dwMid dd ?
       dwOEMVersion dd ?
ends

MHDR_DONE = 1
MHDR_PREPARED = 2
MHDR_INQUEUE = 4
MHDR_ISSTRM = 8

MEVT_F_SHORT = 0
MEVT_F_LONG = $80000000
MEVT_F_CALLBACK = $40000000

;MEVT_EVENTTYPE(x)  ((BYTE)(((x)>>24)&0xFF))
;MEVT_EVENTPARM(x)  ((DWORD)((x)&0x00FFFFFFL))

MEVT_SHORTMSG = 0
MEVT_TEMPO = 1
MEVT_NOP = 2

MEVT_LONGMSG = $80
MEVT_COMMENT = $82
MEVT_VERSION = $84

MIDISTRM_ERROR = -2

MIDIPROP_SET = $80000000
MIDIPROP_GET = $40000000

MIDIPROP_TIMEDIV = 1
MIDIPROP_TEMPO = 2

struct MIDIPROPTIMEDIV
       cbStruct dd ?
       dwTimeDiv dd ?
ends

struct MIDIPROPTEMPO
       cbStruct dd ?
       dwTempo dd ?
ends

struct AUXCAPSA
       wMid dw ?
       wPid dw ?
       vDriverVersion dd ?
       szPname db MAXPNAMELEN dup(?)
       wTechnology dw ?
       wReserved1 dw ?
       dwSupport dd ?
ends

struct AUXCAPSW
       wMid dw ?
       wPid dw ?
       vDriverVersion dd ?
       szPname du MAXPNAMELEN dup(?)
       wTechnology dw ?
       wReserved1 dw ?
       dwSupport dd ?
ends

struct AUXCAPS2A
       wMid dw ?
       wPid dw ?
       vDriverVersion dd ?
       szPname db MAXPNAMELEN dup(?)
       wTechnology dw ?
       wReserved1 dw ?
       dwSupport dd ?
       ManufacturerGuid GUID
       ProductGuid GUID
       NameGuid GUID
ends

struct AUXCAPS2W
       wMid dw ?
       wPid dw ?
       vDriverVersion dd ?
       szPname du MAXPNAMELEN dup(?)
       wTechnology dw ?
       wReserved1 dw ?
       dwSupport dd ?
       ManufacturerGuid GUID
       ProductGuid GUID
       NameGuid GUID
ends

AUXCAPS_CDAUDIO = 1
AUXCAPS_AUXIN = 2

AUXCAPS_VOLUME = 1
AUXCAPS_LRVOLUME = 2

MIXER_SHORT_NAME_CHARS = 16
MIXER_LONG_NAME_CHARS = 64

MIXERR_INVALLINE = MIXERR_BASE + 0
MIXERR_INVALCONTROL = MIXERR_BASE + 1
MIXERR_INVALVALUE = MIXERR_BASE + 2
MIXERR_LASTERROR = MIXERR_BASE + 2

MIXER_OBJECTF_HANDLE = $80000000
MIXER_OBJECTF_MIXER = 0
MIXER_OBJECTF_HMIXER = (MIXER_OBJECTF_HANDLE+MIXER_OBJECTF_MIXER)
MIXER_OBJECTF_WAVEOUT = $10000000
MIXER_OBJECTF_HWAVEOUT = (MIXER_OBJECTF_HANDLE+MIXER_OBJECTF_WAVEOUT)
MIXER_OBJECTF_WAVEIN = $20000000
MIXER_OBJECTF_HWAVEIN = (MIXER_OBJECTF_HANDLE+MIXER_OBJECTF_WAVEIN)
MIXER_OBJECTF_MIDIOUT = $30000000
MIXER_OBJECTF_HMIDIOUT = (MIXER_OBJECTF_HANDLE+MIXER_OBJECTF_MIDIOUT)
MIXER_OBJECTF_MIDIIN = $40000000
MIXER_OBJECTF_HMIDIIN = (MIXER_OBJECTF_HANDLE+MIXER_OBJECTF_MIDIIN)
MIXER_OBJECTF_AUX = $50000000

struct MIXERCAPSA
       wMid dw ?
       wPid dw ?
       vDriverVersion dd ?
       szPname db MAXPNAMELEN dup(?)
       fdwSupport dd ?
       cDestinations dd ?
ends

struct MIXERCAPSW
       wMid dw ?
       wPid dw ?
       vDriverVersion dd ?
       szPname du MAXPNAMELEN dup(?)
       fdwSupport dd ?
       cDestinations dd ?
ends

struct MIXERCAPS2A
       wMid dw ?
       wPid dw ?
       vDriverVersion dd ?
       szPname db MAXPNAMELEN dup(?)
       fdwSupport dd ?
       cDestinations dd ?
       ManufacturerGuid GUID
       ProductGuid GUID
       NameGuid GUID
ends

struct MIXERCAPS2W
       wMid dw ?
       wPid dw ?
       vDriverVersion dd ?
       szPname du MAXPNAMELEN dup(?)
       fdwSupport dd ?
       cDestinations dd ?
       ManufacturerGuid GUID
       ProductGuid GUID
       NameGuid GUID
ends

struct MIXERLINEA
       cbStruct dd ?
       dwDestination dd ?
       dwSource dd ?
       dwLineID dd ?
       fdwLine dd ?,?
       dwUser dq ?
       dwComponentType dd ?
       cChannels dd ?
       cConnections dd ?
       cControls dd ?
       szShortName db MIXER_SHORT_NAME_CHARS dup(?)
       szName db MIXER_LONG_NAME_CHARS dup(?)
       struct
	   dwType dd ?
	   dwDeviceID dd ?
	   wMid dw ?
	   wPid dw ?
	   vDriverVersion dd ?
	   szPname db MAXPNAMELEN dup(?)
       ends
ends

struct MIXERLINEW
       cbStruct dd ?
       dwDestination dd ?
       dwSource dd ?
       dwLineID dd ?
       fdwLine dd ?,?
       dwUser dq ?
       dwComponentType dd ?
       cChannels dd ?
       cConnections dd ?
       cControls dd ?
       szShortName du MIXER_SHORT_NAME_CHARS dup(?)
       szName du MIXER_LONG_NAME_CHARS dup(?)
       struct
	   dwType dd ?
	   dwDeviceID dd ?
	   wMid dw ?
	   wPid dw ?
	   vDriverVersion dd ?
	   szPname du MAXPNAMELEN dup(?)
       ends
ends

MIXERLINE_LINEF_ACTIVE = 1
MIXERLINE_LINEF_DISCONNECTED = $8000
MIXERLINE_LINEF_SOURCE = $80000000

MIXERLINE_COMPONENTTYPE_DST_FIRST = 0
MIXERLINE_COMPONENTTYPE_DST_UNDEFINED = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 0)
MIXERLINE_COMPONENTTYPE_DST_DIGITAL = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 1)
MIXERLINE_COMPONENTTYPE_DST_LINE = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 2)
MIXERLINE_COMPONENTTYPE_DST_MONITOR = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 3)
MIXERLINE_COMPONENTTYPE_DST_SPEAKERS = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 4)
MIXERLINE_COMPONENTTYPE_DST_HEADPHONES	= (MIXERLINE_COMPONENTTYPE_DST_FIRST + 5)
MIXERLINE_COMPONENTTYPE_DST_TELEPHONE = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 6)
MIXERLINE_COMPONENTTYPE_DST_WAVEIN = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 7)
MIXERLINE_COMPONENTTYPE_DST_VOICEIN = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 8)
MIXERLINE_COMPONENTTYPE_DST_LAST = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 8)

MIXERLINE_COMPONENTTYPE_SRC_FIRST = $1000
MIXERLINE_COMPONENTTYPE_SRC_UNDEFINED = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 0)
MIXERLINE_COMPONENTTYPE_SRC_DIGITAL = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 1)
MIXERLINE_COMPONENTTYPE_SRC_LINE = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 2)
MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 3)
MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 4)
MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 5)
MIXERLINE_COMPONENTTYPE_SRC_TELEPHONE = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 6)
MIXERLINE_COMPONENTTYPE_SRC_PCSPEAKER = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 7)
MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 8)
MIXERLINE_COMPONENTTYPE_SRC_AUXILIARY = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 9)
MIXERLINE_COMPONENTTYPE_SRC_ANALOG = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 10)
MIXERLINE_COMPONENTTYPE_SRC_LAST = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 10)

MIXERLINE_TARGETTYPE_UNDEFINED = 0
MIXERLINE_TARGETTYPE_WAVEOUT = 1
MIXERLINE_TARGETTYPE_WAVEIN = 2
MIXERLINE_TARGETTYPE_MIDIOUT = 3
MIXERLINE_TARGETTYPE_MIDIIN = 4
MIXERLINE_TARGETTYPE_AUX = 5

MIXER_GETLINEINFOF_DESTINATION = 0
MIXER_GETLINEINFOF_SOURCE = 1
MIXER_GETLINEINFOF_LINEID = 2
MIXER_GETLINEINFOF_COMPONENTTYPE = 3
MIXER_GETLINEINFOF_TARGETTYPE = 4
MIXER_GETLINEINFOF_QUERYMASK = $F

struct MIXERCONTROLA
       cbStruct dd ?
       dwControlID dd ?
       dwControlType dd ?
       fdwControl dd ?
       cMultipleItems dd ?
       szShortName db MIXER_SHORT_NAME_CHARS dup(?)
       szName db MIXER_LONG_NAME_CHARS dup(?)
       union
	   struct
	       lMinimum dd ?
	       lMaximum dd ?
	   ends
	   struct
	       dwMinimum dd ?
	       dwMaximum dd ?
	   ends
	   dwReserved dd 6 dup(?)
       ends

       union
	   cSteps dd ?
	   cbCustomData dd ?
	   dwReserved2 dd 6 dup(?)
       ends
ends

struct MIXERCONTROLW
       cbStruct dd ?
       dwControlID dd ?
       dwControlType dd ?
       fdwControl dd ?
       cMultipleItems dd ?
       szShortName du MIXER_SHORT_NAME_CHARS dup(?)
       szName du MIXER_LONG_NAME_CHARS dup(?)
       union
	   struct
	       lMinimum dd ?
	       lMaximum dd ?
	   ends
	   struct
	       dwMinimum dd ?
	       dwMaximum dd ?
	   ends
	   dwReserved dd 6 dup(?)
       ends

       union
	   cSteps dd ?
	   cbCustomData dd ?
	   dwReserved2 dd 6 dup(?)
       ends
ends

MIXERCONTROL_CONTROLF_UNIFORM = 1
MIXERCONTROL_CONTROLF_MULTIPLE = 2
MIXERCONTROL_CONTROLF_DISABLED = $80000000

MIXERCONTROL_CT_CLASS_MASK = $F0000000
MIXERCONTROL_CT_CLASS_CUSTOM = 0
MIXERCONTROL_CT_CLASS_METER = $10000000
MIXERCONTROL_CT_CLASS_SWITCH = $20000000
MIXERCONTROL_CT_CLASS_NUMBER = $30000000
MIXERCONTROL_CT_CLASS_SLIDER = $40000000
MIXERCONTROL_CT_CLASS_FADER = $50000000
MIXERCONTROL_CT_CLASS_TIME = $60000000
MIXERCONTROL_CT_CLASS_LIST = $70000000

MIXERCONTROL_CT_SUBCLASS_MASK = $F000000
MIXERCONTROL_CT_SC_SWITCH_BOOLEAN = 0
MIXERCONTROL_CT_SC_SWITCH_BUTTON = $1000000
MIXERCONTROL_CT_SC_METER_POLLED = 0
MIXERCONTROL_CT_SC_TIME_MICROSECS = 0
MIXERCONTROL_CT_SC_TIME_MILLISECS = $1000000
MIXERCONTROL_CT_SC_LIST_SINGLE = 0
MIXERCONTROL_CT_SC_LIST_MULTIPLE = $1000000

MIXERCONTROL_CT_UNITS_MASK = $FF0000
MIXERCONTROL_CT_UNITS_CUSTOM = 0
MIXERCONTROL_CT_UNITS_BOOLEAN = $10000
MIXERCONTROL_CT_UNITS_SIGNED = $20000
MIXERCONTROL_CT_UNITS_UNSIGNED = $30000
MIXERCONTROL_CT_UNITS_DECIBELS = $40000
MIXERCONTROL_CT_UNITS_PERCENT = $50000

MIXERCONTROL_CONTROLTYPE_CUSTOM = (MIXERCONTROL_CT_CLASS_CUSTOM + MIXERCONTROL_CT_UNITS_CUSTOM)
MIXERCONTROL_CONTROLTYPE_BOOLEANMETER = (MIXERCONTROL_CT_CLASS_METER + MIXERCONTROL_CT_SC_METER_POLLED + MIXERCONTROL_CT_UNITS_BOOLEAN)
MIXERCONTROL_CONTROLTYPE_SIGNEDMETER = (MIXERCONTROL_CT_CLASS_METER + MIXERCONTROL_CT_SC_METER_POLLED + MIXERCONTROL_CT_UNITS_SIGNED)
MIXERCONTROL_CONTROLTYPE_PEAKMETER = (MIXERCONTROL_CONTROLTYPE_SIGNEDMETER + 1)
MIXERCONTROL_CONTROLTYPE_UNSIGNEDMETER = (MIXERCONTROL_CT_CLASS_METER + MIXERCONTROL_CT_SC_METER_POLLED + MIXERCONTROL_CT_UNITS_UNSIGNED)
MIXERCONTROL_CONTROLTYPE_BOOLEAN = (MIXERCONTROL_CT_CLASS_SWITCH + MIXERCONTROL_CT_SC_SWITCH_BOOLEAN + MIXERCONTROL_CT_UNITS_BOOLEAN)
MIXERCONTROL_CONTROLTYPE_ONOFF = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 1)
MIXERCONTROL_CONTROLTYPE_MUTE = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 2)
MIXERCONTROL_CONTROLTYPE_MONO = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 3)
MIXERCONTROL_CONTROLTYPE_LOUDNESS = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 4)
MIXERCONTROL_CONTROLTYPE_STEREOENH = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 5)
MIXERCONTROL_CONTROLTYPE_BASS_BOOST = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 0x00002277)
MIXERCONTROL_CONTROLTYPE_BUTTON = (MIXERCONTROL_CT_CLASS_SWITCH + MIXERCONTROL_CT_SC_SWITCH_BUTTON + MIXERCONTROL_CT_UNITS_BOOLEAN)
MIXERCONTROL_CONTROLTYPE_DECIBELS = (MIXERCONTROL_CT_CLASS_NUMBER + MIXERCONTROL_CT_UNITS_DECIBELS)
MIXERCONTROL_CONTROLTYPE_SIGNED = (MIXERCONTROL_CT_CLASS_NUMBER + MIXERCONTROL_CT_UNITS_SIGNED)
MIXERCONTROL_CONTROLTYPE_UNSIGNED = (MIXERCONTROL_CT_CLASS_NUMBER + MIXERCONTROL_CT_UNITS_UNSIGNED)
MIXERCONTROL_CONTROLTYPE_PERCENT = (MIXERCONTROL_CT_CLASS_NUMBER + MIXERCONTROL_CT_UNITS_PERCENT)
MIXERCONTROL_CONTROLTYPE_SLIDER = (MIXERCONTROL_CT_CLASS_SLIDER + MIXERCONTROL_CT_UNITS_SIGNED)
MIXERCONTROL_CONTROLTYPE_PAN = (MIXERCONTROL_CONTROLTYPE_SLIDER + 1)
MIXERCONTROL_CONTROLTYPE_QSOUNDPAN = (MIXERCONTROL_CONTROLTYPE_SLIDER + 2)
MIXERCONTROL_CONTROLTYPE_FADER = (MIXERCONTROL_CT_CLASS_FADER + MIXERCONTROL_CT_UNITS_UNSIGNED)
MIXERCONTROL_CONTROLTYPE_VOLUME = (MIXERCONTROL_CONTROLTYPE_FADER + 1)
MIXERCONTROL_CONTROLTYPE_BASS = (MIXERCONTROL_CONTROLTYPE_FADER + 2)
MIXERCONTROL_CONTROLTYPE_TREBLE = (MIXERCONTROL_CONTROLTYPE_FADER + 3)
MIXERCONTROL_CONTROLTYPE_EQUALIZER = (MIXERCONTROL_CONTROLTYPE_FADER + 4)
MIXERCONTROL_CONTROLTYPE_SINGLESELECT = (MIXERCONTROL_CT_CLASS_LIST + MIXERCONTROL_CT_SC_LIST_SINGLE + MIXERCONTROL_CT_UNITS_BOOLEAN)
MIXERCONTROL_CONTROLTYPE_MUX = (MIXERCONTROL_CONTROLTYPE_SINGLESELECT + 1)
MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT = (MIXERCONTROL_CT_CLASS_LIST + MIXERCONTROL_CT_SC_LIST_MULTIPLE + MIXERCONTROL_CT_UNITS_BOOLEAN)
MIXERCONTROL_CONTROLTYPE_MIXER = (MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT + 1)
MIXERCONTROL_CONTROLTYPE_MICROTIME = (MIXERCONTROL_CT_CLASS_TIME + MIXERCONTROL_CT_SC_TIME_MICROSECS + MIXERCONTROL_CT_UNITS_UNSIGNED)
MIXERCONTROL_CONTROLTYPE_MILLITIME = (MIXERCONTROL_CT_CLASS_TIME + MIXERCONTROL_CT_SC_TIME_MILLISECS + MIXERCONTROL_CT_UNITS_UNSIGNED)

struct MIXERLINECONTROLSA
       cbStruct dd ?
       dwLineID dd ?
       union
	   dwControlID dd ?
	   dwControlType dd ?
       ends
       cControls dd ?
       cbmxctrl dd ?
       pamxctrl dq ?
ends

struct MIXERLINECONTROLSW
       cbStruct dd ?
       dwLineID dd ?
       union
	   dwControlID dd ?
	   dwControlType dd ?
       ends
       cControls dd ?
       cbmxctrl dd ?
       pamxctrl dq ?
ends

MIXER_GETLINECONTROLSF_ALL = 0
MIXER_GETLINECONTROLSF_ONEBYID = 1
MIXER_GETLINECONTROLSF_ONEBYTYPE = 2

MIXER_GETLINECONTROLSF_QUERYMASK = $F

struct MIXERCONTROLDETAILS
       cbStruct dd ?
       dwControlID dd ?
       cChannels dd ?
       union
	   hwndOwner dq ?
	   cMultipleItems dd ?
       ends
       cbDetails dd ?
       paDetails dq ?
ends

struct MIXERCONTROLDETAILSLISTTEXTA
       dwParam1 dd ?
       dwParam2 dd ?
       szName db MIXER_LONG_NAME_CHARS dup(?)
ends

struct MIXERCONTROLDETAILSLISTTEXTW
       dwParam1 dd ?
       dwParam2 dd ?
       szName du MIXER_LONG_NAME_CHARS dup(?)
ends

struct MIXERCONTROLDETAILSBOOLEAN
       fValue dd ?
ends

struct MIXERCONTROLDETAILSSIGNED
       lValue dd ?
ends

struct MIXERCONTROLDETAILSUNSIGNED
       dwValue dd ?
ends

MIXER_GETCONTROLDETAILSF_VALUE = 0
MIXER_GETCONTROLDETAILSF_LISTTEXT = 1
MIXER_GETCONTROLDETAILSF_QUERYMASK = $f

MIXER_SETCONTROLDETAILSF_VALUE = 0
MIXER_SETCONTROLDETAILSF_CUSTOM = 1
MIXER_SETCONTROLDETAILSF_QUERYMASK = $F

TIMERR_NOERROR = 0
TIMERR_NOCANDO = TIMERR_BASE + 1
TIMERR_STRUCT = TIMERR_BASE + 33

TIME_ONESHOT = 0
TIME_PERIODIC = 1

TIME_CALLBACK_FUNCTION = 0
TIME_CALLBACK_EVENT_SET = $10
TIME_CALLBACK_EVENT_PULSE = $20
TIME_KILL_SYNCHRONOUS = $100

struct TIMECAPS
       wPeriodMin dd ?
       wPeriodMax dd ?
ends

JOYERR_NOERROR = 0
JOYERR_PARMS = JOYERR_BASE+5
JOYERR_NOCANDO = JOYERR_BASE+6
JOYERR_UNPLUGGED = JOYERR_BASE+7

JOY_BUTTON1 = 1
JOY_BUTTON2 = 2
JOY_BUTTON3 = 4
JOY_BUTTON4 = 8
JOY_BUTTON1CHG = $100
JOY_BUTTON2CHG = $200
JOY_BUTTON3CHG = $400
JOY_BUTTON4CHG = $800

JOY_BUTTON5 = $10
JOY_BUTTON6 = $20
JOY_BUTTON7 = $40
JOY_BUTTON8 = $80
JOY_BUTTON9 = $100
JOY_BUTTON10 = $200
JOY_BUTTON11 = $400
JOY_BUTTON12 = $800
JOY_BUTTON13 = $1000
JOY_BUTTON14 = $2000
JOY_BUTTON15 = $4000
JOY_BUTTON16 = $8000
JOY_BUTTON17 = $10000
JOY_BUTTON18 = $20000
JOY_BUTTON19 = $40000
JOY_BUTTON20 = $80000
JOY_BUTTON21 = $100000
JOY_BUTTON22 = $200000
JOY_BUTTON23 = $400000
JOY_BUTTON24 = $800000
JOY_BUTTON25 = $1000000
JOY_BUTTON26 = $2000000
JOY_BUTTON27 = $4000000
JOY_BUTTON28 = $8000000
JOY_BUTTON29 = $10000000
JOY_BUTTON30 = $20000000
JOY_BUTTON31 = $40000000
JOY_BUTTON32 = $80000000

JOY_POVCENTERED = -1
JOY_POVFORWARD = 0
JOY_POVRIGHT = 9000
JOY_POVBACKWARD = 18000
JOY_POVLEFT = 27000

JOY_RETURNX = $1
JOY_RETURNY = $2
JOY_RETURNZ = $4
JOY_RETURNR = $8
JOY_RETURNU = $10
JOY_RETURNV = $20
JOY_RETURNPOV = $40
JOY_RETURNBUTTONS = $80
JOY_RETURNRAWDATA = $100
JOY_RETURNPOVCTS = $200
JOY_RETURNCENTERED = $400
JOY_USEDEADZONE = $800
JOY_RETURNALL = (JOY_RETURNX + JOY_RETURNY + JOY_RETURNZ + JOY_RETURNR + JOY_RETURNU +\
		 JOY_RETURNV + JOY_RETURNPOV + JOY_RETURNBUTTONS)
JOY_CAL_READALWAYS = $10000
JOY_CAL_READXYONLY = $20000
JOY_CAL_READ3 = $40000
JOY_CAL_READ4 = $80000
JOY_CAL_READXONLY = $100000
JOY_CAL_READYONLY = $200000
JOY_CAL_READ5 = $400000
JOY_CAL_READ6 = $800000
JOY_CAL_READZONLY = $1000000
JOY_CAL_READRONLY = $2000000
JOY_CAL_READUONLY = $4000000
JOY_CAL_READVONLY = $8000000

JOYSTICKID1 = 0
JOYSTICKID2 = 1

JOYCAPS_HASZ = 1
JOYCAPS_HASR = 2
JOYCAPS_HASU = 4
JOYCAPS_HASV = 8
JOYCAPS_HASPOV = $10
JOYCAPS_POV4DIR = $20
JOYCAPS_POVCTS = $40

struct JOYCAPSA
       wMid dw ?
       wPid dw ?
       szPname db MAXPNAMELEN dup(?)
       wXmin dd ?
       wXmax dd ?
       wYmin dd ?
       wYmax dd ?
       wZmin dd ?
       wZmax dd ?
       wNumButtons dd ?
       wPeriodMin dd ?
       wPeriodMax dd ?
       wRmin dd ?
       wRmax dd ?
       wUmin dd ?
       wUmax dd ?
       wVmin dd ?
       wVmax dd ?
       wCaps dd ?
       wMaxAxes dd ?
       wNumAxes dd ?
       wMaxButtons dd ?
       szRegKey db MAXPNAMELEN dup(?)
       szOEMVxD db MAX_JOYSTICKOEMVXDNAME dup(?)
ends

struct JOYCAPSW
       wMid dw ?
       wPid dw ?
       szPname du MAXPNAMELEN dup(?)
       wXmin dd ?
       wXmax dd ?
       wYmin dd ?
       wYmax dd ?
       wZmin dd ?
       wZmax dd ?
       wNumButtons dd ?
       wPeriodMin dd ?
       wPeriodMax dd ?
       wRmin dd ?
       wRmax dd ?
       wUmin dd ?
       wUmax dd ?
       wVmin dd ?
       wVmax dd ?
       wCaps dd ?
       wMaxAxes dd ?
       wNumAxes dd ?
       wMaxButtons dd ?
       szRegKey du MAXPNAMELEN dup(?)
       szOEMVxD du MAX_JOYSTICKOEMVXDNAME dup(?)
ends

struct JOYCAPS2A
       wMid dw ?
       wPid dw ?
       szPname db MAXPNAMELEN dup(?)
       wXmin dd ?
       wXmax dd ?
       wYmin dd ?
       wYmax dd ?
       wZmin dd ?
       wZmax dd ?
       wNumButtons dd ?
       wPeriodMin dd ?
       wPeriodMax dd ?
       wRmin dd ?
       wRmax dd ?
       wUmin dd ?
       wUmax dd ?
       wVmin dd ?
       wVmax dd ?
       wCaps dd ?
       wMaxAxes dd ?
       wNumAxes dd ?
       wMaxButtons dd ?
       szRegKey db MAXPNAMELEN dup(?)
       szOEMVxD db MAX_JOYSTICKOEMVXDNAME dup(?)
       ManufacturerGuid GUID
       ProductGuid GUID
       NameGuid GUID
ends

struct JOYCAPS2W
       wMid dw ?
       wPid dw ?
       szPname du MAXPNAMELEN dup(?)
       wXmin dd ?
       wXmax dd ?
       wYmin dd ?
       wYmax dd ?
       wZmin dd ?
       wZmax dd ?
       wNumButtons dd ?
       wPeriodMin dd ?
       wPeriodMax dd ?
       wRmin dd ?
       wRmax dd ?
       wUmin dd ?
       wUmax dd ?
       wVmin dd ?
       wVmax dd ?
       wCaps dd ?
       wMaxAxes dd ?
       wNumAxes dd ?
       wMaxButtons dd ?
       szRegKey du MAXPNAMELEN dup(?)
       szOEMVxD du MAX_JOYSTICKOEMVXDNAME dup(?)
       ManufacturerGuid GUID
       ProductGuid GUID
       NameGuid GUID
ends

struct JOYINFO
       wXpos dd ?
       wYpos dd ?
       wZpos dd ?
       wButtons dd ?
ends

struct JOYINFOEX
       dwSize dd ?
       dwFlags dd ?
       dwXpos dd ?
       dwYpos dd ?
       dwZpos dd ?
       dwRpos dd ?
       dwUpos dd ?
       dwVpos dd ?
       dwButtons dd ?
       dwButtonNumber dd ?
       dwPOV dd ?
       dwReserved1 dd ?
       dwReserved2 dd ?
ends

MMIOERR_BASE = 256
MMIOERR_FILENOTFOUND = (MMIOERR_BASE + 1)
MMIOERR_OUTOFMEMORY = (MMIOERR_BASE + 2)
MMIOERR_CANNOTOPEN = (MMIOERR_BASE + 3)
MMIOERR_CANNOTCLOSE = (MMIOERR_BASE + 4)
MMIOERR_CANNOTREAD = (MMIOERR_BASE + 5)
MMIOERR_CANNOTWRITE = (MMIOERR_BASE + 6)
MMIOERR_CANNOTSEEK = (MMIOERR_BASE + 7)
MMIOERR_CANNOTEXPAND = (MMIOERR_BASE + 8)
MMIOERR_CHUNKNOTFOUND = (MMIOERR_BASE + 9)
MMIOERR_UNBUFFERED = (MMIOERR_BASE + 10)
MMIOERR_PATHNOTFOUND = (MMIOERR_BASE + 11)
MMIOERR_ACCESSDENIED = (MMIOERR_BASE + 12)
MMIOERR_SHARINGVIOLATION = (MMIOERR_BASE + 13)
MMIOERR_NETWORKERROR = (MMIOERR_BASE + 14)
MMIOERR_TOOMANYOPENFILES = (MMIOERR_BASE + 15)
MMIOERR_INVALIDFILE = (MMIOERR_BASE + 16)

struct MMIOINFO
       dwFlags dd ?
       fccIOProc dd ?
       pIOProc dq ?
       wErrorRet dd ?
       htask dq ?
       cchBuffer dd ?
       pchBuffer dq ?
       pchNext dq ?
       pchEndRead dq ?
       pchEndWrite dq ?
       lBufOffset dd ?
       lDiskOffset dd ?
       adwInfo dd ?,?,?
       dwReserved1 dd ?
       dwReserved2 dd ?
       hmmio dq ?
ends

struct MMCKINFO
       ckid dd ?
       cksize dd ?
       fccType dd ?
       dwDataOffset dd ?
       dwFlags dd ?
ends

MMIO_RWMODE = 3
MMIO_SHAREMODE = $70
MMIO_CREATE = $1000
MMIO_PARSE = $100
MMIO_DELETE = $200
MMIO_EXIST = $4000
MMIO_ALLOCBUF = $10000
MMIO_GETTEMP = $20000
MMIO_DIRTY = $10000000
MMIO_READ = 0
MMIO_WRITE = 1
MMIO_READWRITE = 2
MMIO_COMPAT = 0
MMIO_EXCLUSIVE = $10
MMIO_DENYWRITE = $20
MMIO_DENYREAD = $30
MMIO_DENYNONE = $40
MMIO_FHOPEN = $10
MMIO_EMPTYBUF = $10
MMIO_TOUPPER = $10
MMIO_INSTALLPROC = $10000
MMIO_GLOBALPROC = $10000000
MMIO_REMOVEPROC = $20000
MMIO_UNICODEPROC = $1000000
MMIO_FINDPROC = $40000
MMIO_FINDCHUNK = $10
MMIO_FINDRIFF = $20
MMIO_FINDLIST = $40
MMIO_CREATERIFF = $20
MMIO_CREATELIST = $40

MMIOM_READ = MMIO_READ
MMIOM_WRITE = MMIO_WRITE
MMIOM_SEEK = 2
MMIOM_OPEN = 3
MMIOM_CLOSE = 4
MMIOM_WRITEFLUSH = 5
MMIOM_RENAME = 6
MMIOM_USER = $8000

FOURCC_RIFF equ 'RIFF'
FOURCC_LIST equ 'LIST'
FOURCC_DOS equ 'DOS '
FOURCC_MEM equ 'MEM '

SEEK_SET = 0
SEEK_CUR = 1
SEEK_END = 2

MMIO_DEFAULTBUFFER = 8192
MCIERR_INVALID_DEVICE_ID = (MCIERR_BASE + 1)
MCIERR_UNRECOGNIZED_KEYWORD = (MCIERR_BASE + 3)
MCIERR_UNRECOGNIZED_COMMAND = (MCIERR_BASE + 5)
MCIERR_HARDWARE = (MCIERR_BASE + 6)
MCIERR_INVALID_DEVICE_NAME = (MCIERR_BASE + 7)
MCIERR_OUT_OF_MEMORY = (MCIERR_BASE + 8)
MCIERR_DEVICE_OPEN = (MCIERR_BASE + 9)
MCIERR_CANNOT_LOAD_DRIVER = (MCIERR_BASE + 10)
MCIERR_MISSING_COMMAND_STRING = (MCIERR_BASE + 11)
MCIERR_PARAM_OVERFLOW = (MCIERR_BASE + 12)
MCIERR_MISSING_STRING_ARGUMENT = (MCIERR_BASE + 13)
MCIERR_BAD_INTEGER = (MCIERR_BASE + 14)
MCIERR_PARSER_INTERNAL = (MCIERR_BASE + 15)
MCIERR_DRIVER_INTERNAL = (MCIERR_BASE + 16)
MCIERR_MISSING_PARAMETER = (MCIERR_BASE + 17)
MCIERR_UNSUPPORTED_FUNCTION = (MCIERR_BASE + 18)
MCIERR_FILE_NOT_FOUND = (MCIERR_BASE + 19)
MCIERR_DEVICE_NOT_READY = (MCIERR_BASE + 20)
MCIERR_INTERNAL = (MCIERR_BASE + 21)
MCIERR_DRIVER = (MCIERR_BASE + 22)
MCIERR_CANNOT_USE_ALL = (MCIERR_BASE + 23)
MCIERR_MULTIPLE = (MCIERR_BASE + 24)
MCIERR_EXTENSION_NOT_FOUND = (MCIERR_BASE + 25)
MCIERR_OUTOFRANGE = (MCIERR_BASE + 26)
MCIERR_FLAGS_NOT_COMPATIBLE = (MCIERR_BASE + 28)
MCIERR_FILE_NOT_SAVED = (MCIERR_BASE + 30)
MCIERR_DEVICE_TYPE_REQUIRED = (MCIERR_BASE + 31)
MCIERR_DEVICE_LOCKED = (MCIERR_BASE + 32)
MCIERR_DUPLICATE_ALIAS = (MCIERR_BASE + 33)
MCIERR_BAD_CONSTANT = (MCIERR_BASE + 34)
MCIERR_MUST_USE_SHAREABLE = (MCIERR_BASE + 35)
MCIERR_MISSING_DEVICE_NAME = (MCIERR_BASE + 36)
MCIERR_BAD_TIME_FORMAT = (MCIERR_BASE + 37)
MCIERR_NO_CLOSING_QUOTE = (MCIERR_BASE + 38)
MCIERR_DUPLICATE_FLAGS = (MCIERR_BASE + 39)
MCIERR_INVALID_FILE = (MCIERR_BASE + 40)
MCIERR_NULL_PARAMETER_BLOCK = (MCIERR_BASE + 41)
MCIERR_UNNAMED_RESOURCE = (MCIERR_BASE + 42)
MCIERR_NEW_REQUIRES_ALIAS = (MCIERR_BASE + 43)
MCIERR_NOTIFY_ON_AUTO_OPEN = (MCIERR_BASE + 44)
MCIERR_NO_ELEMENT_ALLOWED = (MCIERR_BASE + 45)
MCIERR_NONAPPLICABLE_FUNCTION = (MCIERR_BASE + 46)
MCIERR_ILLEGAL_FOR_AUTO_OPEN = (MCIERR_BASE + 47)
MCIERR_FILENAME_REQUIRED = (MCIERR_BASE + 48)
MCIERR_EXTRA_CHARACTERS = (MCIERR_BASE + 49)
MCIERR_DEVICE_NOT_INSTALLED = (MCIERR_BASE + 50)
MCIERR_GET_CD = (MCIERR_BASE + 51)
MCIERR_SET_CD = (MCIERR_BASE + 52)
MCIERR_SET_DRIVE = (MCIERR_BASE + 53)
MCIERR_DEVICE_LENGTH = (MCIERR_BASE + 54)
MCIERR_DEVICE_ORD_LENGTH = (MCIERR_BASE + 55)
MCIERR_NO_INTEGER = (MCIERR_BASE + 56)

MCIERR_WAVE_OUTPUTSINUSE = (MCIERR_BASE + 64)
MCIERR_WAVE_SETOUTPUTINUSE = (MCIERR_BASE + 65)
MCIERR_WAVE_INPUTSINUSE = (MCIERR_BASE + 66)
MCIERR_WAVE_SETINPUTINUSE = (MCIERR_BASE + 67)
MCIERR_WAVE_OUTPUTUNSPECIFIED = (MCIERR_BASE + 68)
MCIERR_WAVE_INPUTUNSPECIFIED = (MCIERR_BASE + 69)
MCIERR_WAVE_OUTPUTSUNSUITABLE = (MCIERR_BASE + 70)
MCIERR_WAVE_SETOUTPUTUNSUITABLE = (MCIERR_BASE + 71)
MCIERR_WAVE_INPUTSUNSUITABLE = (MCIERR_BASE + 72)
MCIERR_WAVE_SETINPUTUNSUITABLE = (MCIERR_BASE + 73)

MCIERR_SEQ_DIV_INCOMPATIBLE = (MCIERR_BASE + 80)
MCIERR_SEQ_PORT_INUSE = (MCIERR_BASE + 81)
MCIERR_SEQ_PORT_NONEXISTENT = (MCIERR_BASE + 82)
MCIERR_SEQ_PORT_MAPNODEVICE = (MCIERR_BASE + 83)
MCIERR_SEQ_PORT_MISCERROR = (MCIERR_BASE + 84)
MCIERR_SEQ_TIMER = (MCIERR_BASE + 85)
MCIERR_SEQ_PORTUNSPECIFIED = (MCIERR_BASE + 86)
MCIERR_SEQ_NOMIDIPRESENT = (MCIERR_BASE + 87)

MCIERR_NO_WINDOW = (MCIERR_BASE + 90)
MCIERR_CREATEWINDOW = (MCIERR_BASE + 91)
MCIERR_FILE_READ = (MCIERR_BASE + 92)
MCIERR_FILE_WRITE = (MCIERR_BASE + 93)
MCIERR_NO_IDENTITY = (MCIERR_BASE + 94)
MCIERR_CUSTOM_DRIVER_BASE = (MCIERR_BASE + 256)

MCI_FIRST = DRV_MCI_FIRST
MCI_OPEN = $803
MCI_CLOSE = $804
MCI_ESCAPE = $805
MCI_PLAY = $806
MCI_SEEK = $807
MCI_STOP = $808
MCI_PAUSE = $809
MCI_INFO = $80A
MCI_GETDEVCAPS = $80B
MCI_SPIN = $80C
MCI_SET = $80D
MCI_STEP = $80E
MCI_RECORD = $80F
MCI_SYSINFO = $810
MCI_BREAK = $811
MCI_SAVE = $813
MCI_STATUS = $814
MCI_CUE = $830
MCI_REALIZE = $840
MCI_WINDOW = $841
MCI_PUT = $842
MCI_WHERE = $843
MCI_FREEZE = $844
MCI_UNFREEZE = $845
MCI_LOAD = $850
MCI_CUT = $851
MCI_COPY = $852
MCI_PASTE = $853
MCI_UPDATE = $854
MCI_RESUME = $855
MCI_DELETE = $856

MCI_USER_MESSAGES = (DRV_MCI_FIRST + $400)
MCI_LAST = $FFF

MCI_ALL_DEVICE_ID = -1

MCI_DEVTYPE_VCR = 513
MCI_DEVTYPE_VIDEODISC = 514
MCI_DEVTYPE_OVERLAY = 515
MCI_DEVTYPE_CD_AUDIO = 516
MCI_DEVTYPE_DAT = 517
MCI_DEVTYPE_SCANNER = 518
MCI_DEVTYPE_ANIMATION = 519
MCI_DEVTYPE_DIGITAL_VIDEO = 520
MCI_DEVTYPE_OTHER = 521
MCI_DEVTYPE_WAVEFORM_AUDIO = 522
MCI_DEVTYPE_SEQUENCER = 523

MCI_DEVTYPE_FIRST = MCI_DEVTYPE_VCR
MCI_DEVTYPE_LAST = MCI_DEVTYPE_SEQUENCER

MCI_DEVTYPE_FIRST_USER = $1000
MCI_MODE_NOT_READY = (MCI_STRING_OFFSET + 12)
MCI_MODE_STOP = (MCI_STRING_OFFSET + 13)
MCI_MODE_PLAY = (MCI_STRING_OFFSET + 14)
MCI_MODE_RECORD = (MCI_STRING_OFFSET + 15)
MCI_MODE_SEEK = (MCI_STRING_OFFSET + 16)
MCI_MODE_PAUSE = (MCI_STRING_OFFSET + 17)
MCI_MODE_OPEN = (MCI_STRING_OFFSET + 18)

MCI_FORMAT_MILLISECONDS = 0
MCI_FORMAT_HMS = 1
MCI_FORMAT_MSF = 2
MCI_FORMAT_FRAMES = 3
MCI_FORMAT_SMPTE_24 = 4
MCI_FORMAT_SMPTE_25 = 5
MCI_FORMAT_SMPTE_30 = 6
MCI_FORMAT_SMPTE_30DROP = 7
MCI_FORMAT_BYTES = 8
MCI_FORMAT_SAMPLES = 9
MCI_FORMAT_TMSF = 10

MCI_NOTIFY_SUCCESSFUL = 1
MCI_NOTIFY_SUPERSEDED = 2
MCI_NOTIFY_ABORTED = 4
MCI_NOTIFY_FAILURE = 8

MCI_NOTIFY = 1
MCI_WAIT = 2
MCI_FROM = 4
MCI_TO = 8
MCI_TRACK = $10

MCI_OPEN_SHAREABLE = $100
MCI_OPEN_ELEMENT = $200
MCI_OPEN_ALIAS = $400
MCI_OPEN_ELEMENT_ID = $800
MCI_OPEN_TYPE_ID = $1000
MCI_OPEN_TYPE = $2000

MCI_SEEK_TO_START = $100
MCI_SEEK_TO_END = $200

MCI_STATUS_ITEM = $100
MCI_STATUS_START = $200
MCI_STATUS_LENGTH = 1
MCI_STATUS_POSITION = 2
MCI_STATUS_NUMBER_OF_TRACKS = 3
MCI_STATUS_MODE = 4
MCI_STATUS_MEDIA_PRESENT = 5
MCI_STATUS_TIME_FORMAT = 6
MCI_STATUS_READY = 7
MCI_STATUS_CURRENT_TRACK = 8

MCI_INFO_PRODUCT = $100
MCI_INFO_FILE = $200
MCI_INFO_MEDIA_UPC = $400
MCI_INFO_MEDIA_IDENTITY = $800
MCI_INFO_NAME = $1000
MCI_INFO_COPYRIGHT = $2000

MCI_GETDEVCAPS_ITEM = $100
MCI_GETDEVCAPS_CAN_RECORD = 1
MCI_GETDEVCAPS_HAS_AUDIO = 2
MCI_GETDEVCAPS_HAS_VIDEO = 3
MCI_GETDEVCAPS_DEVICE_TYPE = 4
MCI_GETDEVCAPS_USES_FILES = 5
MCI_GETDEVCAPS_COMPOUND_DEVICE	= 6
MCI_GETDEVCAPS_CAN_EJECT = 7
MCI_GETDEVCAPS_CAN_PLAY = 8
MCI_GETDEVCAPS_CAN_SAVE = 9

MCI_SYSINFO_QUANTITY = $100
MCI_SYSINFO_OPEN = $200
MCI_SYSINFO_NAME = $400
MCI_SYSINFO_INSTALLNAME = $800

MCI_SET_DOOR_OPEN = $100
MCI_SET_DOOR_CLOSED = $200
MCI_SET_TIME_FORMAT = $400
MCI_SET_AUDIO = $800
MCI_SET_VIDEO = $1000
MCI_SET_ON = $2000
MCI_SET_OFF = $4000
MCI_SET_AUDIO_ALL = 0
MCI_SET_AUDIO_LEFT = 1
MCI_SET_AUDIO_RIGHT = 2

MCI_BREAK_KEY = $100
MCI_BREAK_HWND = $200
MCI_BREAK_OFF = $400
MCI_RECORD_INSERT = $100
MCI_RECORD_OVERWRITE = $200
MCI_SAVE_FILE = $100
MCI_LOAD_FILE = $100

struct MCIGENERICPARMS
       dwCallback dq ?
ends

struct MCIOPENPARMSA
       dwCallback dq ?
       wDeviceID dd ?
       lpstrDeviceType dq ?
       lpstrElementName dq ?
       lpstrAlias dq ?
ends

struct MCIOPENPARMSW
       dwCallback dq ?
       wDeviceID dd ?
       lpstrDeviceType dq ?
       lpstrElementName dq ?
       lpstrAlias dq ?
ends

struct MCIPLAYPARMS
       dwCallback dq ?
       dwFrom dd ?
       dwTo dd ?
ends

struct MCISEEKPARMS
       dwCallback dq ?
       dwTo dd ?
ends

struct MCISTATUSPARMS
       dwCallback dq ?
       dwReturn dq ?
       dwItem dd ?
       dwTrack dd ?
ends

struct MCIINFOPARMSA
       dwCallback dq ?
       lpstrReturn dq ?
       dwRetSize dd ?
ends

struct MCIINFOPARMSW
       dwCallback dq ?
       lpstrReturn dq ?
       dwRetSize dd ?
ends

struct MCIGETDEVCAPSPARMS
       dwCallback dq ?
       dwReturn dd ?
       dwItem dd ?
ends

struct MCISYSINFOPARMSA
       dwCallback dq ?
       lpstrReturn dq ?
       dwRetSize dd ?
       dwNumber dd ?
       wDeviceType dd ?
ends

struct MCISYSINFOPARMSW
       dwCallback dq ?
       lpstrReturn dq ?
       dwRetSize dd ?
       dwNumber dd ?
       wDeviceType dd ?
ends

struct MCISETPARMS
       dwCallback dq ?
       dwTimeFormat dd ?
       dwAudio dd ?
ends

struct MCIBREAKPARMS
       dwCallback dq ?
       nVirtKey dd ?
       hwndBreak dq ?
ends

struct MCISAVEPARMSA
       dwCallback dq ?
       lpfilename dq ?
ends

struct MCISAVEPARMSW
       dwCallback dq ?
       lpfilename dq ?
ends

struct MCILOADPARMSA
       dwCallback dq ?
       lpfilename dq ?
ends

struct MCILOADPARMSW
       dwCallback dq ?
       lpfilename dq ?
ends

struct MCIRECORDPARMS
       dwCallback dq ?
       dwFrom dd ?
       dwTo dd ?
ends

MCI_VD_MODE_PARK = (MCI_VD_OFFSET + 1)
MCI_VD_MEDIA_CLV = (MCI_VD_OFFSET + 2)
MCI_VD_MEDIA_CAV = (MCI_VD_OFFSET + 3)
MCI_VD_MEDIA_OTHER = (MCI_VD_OFFSET + 4)
MCI_VD_FORMAT_TRACK = $4001
MCI_VD_PLAY_REVERSE = $10000
MCI_VD_PLAY_FAST = $20000
MCI_VD_PLAY_SPEED = $40000
MCI_VD_PLAY_SCAN = $80000
MCI_VD_PLAY_SLOW = $100000
MCI_VD_SEEK_REVERSE = $10000
MCI_VD_STATUS_SPEED = $4002
MCI_VD_STATUS_FORWARD = $4003
MCI_VD_STATUS_MEDIA_TYPE = $4004
MCI_VD_STATUS_SIDE = $4005
MCI_VD_STATUS_DISC_SIZE = $4006
MCI_VD_GETDEVCAPS_CLV = $10000
MCI_VD_GETDEVCAPS_CAV = $20000
MCI_VD_SPIN_UP = $10000
MCI_VD_SPIN_DOWN = $20000
MCI_VD_GETDEVCAPS_CAN_REVERSE = $4002
MCI_VD_GETDEVCAPS_FAST_RATE = $4003
MCI_VD_GETDEVCAPS_SLOW_RATE = $4004
MCI_VD_GETDEVCAPS_NORMAL_RATE = $4005
MCI_VD_STEP_FRAMES = $10000
MCI_VD_STEP_REVERSE = $20000
MCI_VD_ESCAPE_STRING = $100

struct MCIVDPLAYPARMS
       dwCallback dq ?
       dwFrom dd ?
       dwTo dd ?
       dwSpeed dd ?
ends

struct MCIVDSTEPPARMS
       dwCallback dq ?
       dwFrames dd ?
ends

struct MCIVDESCAPEPARMSA
       dwCallback dq ?
       lpstrCommand dq ?
ends

struct MCIVDESCAPEPARMSW
       dwCallback dq ?
       lpstrCommand dq ?
ends

MCI_CDA_STATUS_TYPE_TRACK	= $4001
MCI_CDA_TRACK_AUDIO		= (MCI_CD_OFFSET + 0)
MCI_CDA_TRACK_OTHER		= (MCI_CD_OFFSET + 1)

MCI_WAVE_PCM			= (MCI_WAVE_OFFSET + 0)
MCI_WAVE_MAPPER 		= (MCI_WAVE_OFFSET + 1)
MCI_WAVE_OPEN_BUFFER		= $10000
MCI_WAVE_SET_FORMATTAG		= $10000
MCI_WAVE_SET_CHANNELS		= $20000
MCI_WAVE_SET_SAMPLESPERSEC	= $40000
MCI_WAVE_SET_AVGBYTESPERSEC	= $80000
MCI_WAVE_SET_BLOCKALIGN 	= $100000
MCI_WAVE_SET_BITSPERSAMPLE	= $200000
MCI_WAVE_INPUT			= $400000
MCI_WAVE_OUTPUT 		= $800000
MCI_WAVE_STATUS_FORMATTAG	= $4001
MCI_WAVE_STATUS_CHANNELS	= $4002
MCI_WAVE_STATUS_SAMPLESPERSEC	= $4003
MCI_WAVE_STATUS_AVGBYTESPERSEC	= $4004
MCI_WAVE_STATUS_BLOCKALIGN	= $4005
MCI_WAVE_STATUS_BITSPERSAMPLE	= $4006
MCI_WAVE_STATUS_LEVEL		= $4007
MCI_WAVE_SET_ANYINPUT		= $4000000
MCI_WAVE_SET_ANYOUTPUT		= $8000000
MCI_WAVE_GETDEVCAPS_INPUTS	= $4001
MCI_WAVE_GETDEVCAPS_OUTPUTS	= $4002

struct MCIWAVEOPENPARMSA
       dwCallback dq ?
       wDeviceID dd ?
       lpstrDeviceType dq ?
       lpstrElementName dq ?
       lpstrAlias dq ?
       dwBufferSeconds dd ?
ends

struct MCIWAVEOPENPARMSW
       dwCallback dq ?
       wDeviceID dd ?
       lpstrDeviceType dq ?
       lpstrElementName dq ?
       lpstrAlias dq ?
       dwBufferSeconds dd ?
ends

struct MCIWAVEDELETEPARMS
       dwCallback dq ?
       dwFrom dd ?
       dwTo dd ?
ends

struct MCIWAVESETPARMS
       dwCallback dq ?
       dwTimeFormat dd ?
       dwAudio dd ?
       wInput dd ?
       wOutput dd ?
       wFormatTag dw ?
       wReserved2 dw ?
       nChannels dw ?
       wReserved3 dw ?
       nSamplesPerSec dd ?
       nAvgBytesPerSec dd ?
       nBlockAlign dw ?
       wReserved4 dw ?
       wBitsPerSample dw ?
       wReserved5 dw ?
ends

MCI_SEQ_DIV_PPQN = (0 + MCI_SEQ_OFFSET)
MCI_SEQ_DIV_SMPTE_24 = (1 + MCI_SEQ_OFFSET)
MCI_SEQ_DIV_SMPTE_25 = (2 + MCI_SEQ_OFFSET)
MCI_SEQ_DIV_SMPTE_30DROP = (3 + MCI_SEQ_OFFSET)
MCI_SEQ_DIV_SMPTE_30 = (4 + MCI_SEQ_OFFSET)

MCI_SEQ_FORMAT_SONGPTR = $4001
MCI_SEQ_FILE = $4002
MCI_SEQ_MIDI = $4003
MCI_SEQ_SMPTE = $4004
MCI_SEQ_NONE = 65533
MCI_SEQ_MAPPER = 65535

MCI_SEQ_STATUS_TEMPO = $4002
MCI_SEQ_STATUS_PORT = $4003
MCI_SEQ_STATUS_SLAVE = $4007
MCI_SEQ_STATUS_MASTER = $4008
MCI_SEQ_STATUS_OFFSET = $4009
MCI_SEQ_STATUS_DIVTYPE = $400A
MCI_SEQ_STATUS_NAME = $400B
MCI_SEQ_STATUS_COPYRIGHT = $400C

MCI_SEQ_SET_TEMPO = $10000
MCI_SEQ_SET_PORT = $20000
MCI_SEQ_SET_SLAVE = $40000
MCI_SEQ_SET_MASTER = $80000
MCI_SEQ_SET_OFFSET = $1000000

struct MCISEQSETPARMS
       dwCallback dq ?
       dwTimeFormat dd ?
       dwAudio dd ?
       dwTempo dd ?
       dwPort dd ?
       dwSlave dd ?
       dwMaster dd ?
       dwOffset dd ?
ends

MCI_ANIM_OPEN_WS = $10000
MCI_ANIM_OPEN_PARENT = $20000
MCI_ANIM_OPEN_NOSTATIC = $40000
MCI_ANIM_PLAY_SPEED = $10000
MCI_ANIM_PLAY_REVERSE = $20000
MCI_ANIM_PLAY_FAST = $40000
MCI_ANIM_PLAY_SLOW = $80000
MCI_ANIM_PLAY_SCAN = $100000
MCI_ANIM_STEP_REVERSE = $10000
MCI_ANIM_STEP_FRAMES = $20000
MCI_ANIM_STATUS_SPEED = $4001
MCI_ANIM_STATUS_FORWARD = $4002
MCI_ANIM_STATUS_HWND = $4003
MCI_ANIM_STATUS_HPAL = $4004
MCI_ANIM_STATUS_STRETCH = $4005
MCI_ANIM_INFO_TEXT = $10000
MCI_ANIM_GETDEVCAPS_CAN_REVERSE = $4001
MCI_ANIM_GETDEVCAPS_FAST_RATE = $4002
MCI_ANIM_GETDEVCAPS_SLOW_RATE = $4003
MCI_ANIM_GETDEVCAPS_NORMAL_RATE = $4004
MCI_ANIM_GETDEVCAPS_PALETTES = $4006
MCI_ANIM_GETDEVCAPS_CAN_STRETCH = $4007
MCI_ANIM_GETDEVCAPS_MAX_WINDOWS = $4008
MCI_ANIM_REALIZE_NORM = $10000
MCI_ANIM_REALIZE_BKGD = $20000
MCI_ANIM_WINDOW_HWND = $10000
MCI_ANIM_WINDOW_STATE = $40000
MCI_ANIM_WINDOW_TEXT = $80000
MCI_ANIM_WINDOW_ENABLE_STRETCH = $100000
MCI_ANIM_WINDOW_DISABLE_STRETCH = $200000
MCI_ANIM_WINDOW_DEFAULT = 0
MCI_ANIM_RECT = $10000
MCI_ANIM_PUT_SOURCE = $20000
MCI_ANIM_PUT_DESTINATION = $40000
MCI_ANIM_WHERE_SOURCE = $20000
MCI_ANIM_WHERE_DESTINATION = $40000
MCI_ANIM_UPDATE_HDC = $20000

struct MCIANIMOPENPARMSA
       dwCallback dq ?
       wDeviceID dd ?
       lpstrDeviceType dq ?
       lpstrElementName dq ?
       lpstrAlias dq ?
       dwStyle dd ?
       hWndParent dq ?
ends

struct MCIANIMOPENPARMSW
       dwCallback dq ?
       wDeviceID dd ?
       lpstrDeviceType dq ?
       lpstrElementName dq ?
       lpstrAlias dq ?
       dwStyle dd ?
       hWndParent dq ?
ends

struct MCIANIMPLAYPARMS
       dwCallback dq ?
       dwFrom dd ?
       dwTo dd ?
       dwSpeed dd ?
ends

struct MCIANIMSTEPPARMS
       dwCallback dq ?
       dwFrames dd ?
ends

struct MCIANIMWINDOWPARMSA
       dwCallback dq ?
       hWnd dq ?
       nCmdShow dd ?
       lpstrText dq ?
ends

struct MCIANIMWINDOWPARMSW
       dwCallback dq ?
       hWnd dq ?
       nCmdShow dd ?
       lpstrText dq ?
ends

struct MCIANIMRECTPARMS
       dwCallback dq ?
       rc RECT
ends

struct MCIANIMUPDATEPARMS
       dwCallback dq ?
       rc RECT
       hDC dq ?
ends

MCI_OVLY_OPEN_WS = $10000
MCI_OVLY_OPEN_PARENT = $20000
MCI_OVLY_STATUS_HWND = $4001
MCI_OVLY_STATUS_STRETCH = $4002
MCI_OVLY_INFO_TEXT = $10000
MCI_OVLY_GETDEVCAPS_CAN_STRETCH = $4001
MCI_OVLY_GETDEVCAPS_CAN_FREEZE = $4002
MCI_OVLY_GETDEVCAPS_MAX_WINDOWS = $4003
MCI_OVLY_WINDOW_HWND = $10000
MCI_OVLY_WINDOW_STATE = $40000
MCI_OVLY_WINDOW_TEXT = $80000
MCI_OVLY_WINDOW_ENABLE_STRETCH = $100000
MCI_OVLY_WINDOW_DISABLE_STRETCH = $200000
MCI_OVLY_WINDOW_DEFAULT = 0
MCI_OVLY_RECT = $10000
MCI_OVLY_PUT_SOURCE = $20000
MCI_OVLY_PUT_DESTINATION = $40000
MCI_OVLY_PUT_FRAME = $80000
MCI_OVLY_PUT_VIDEO = $100000
MCI_OVLY_WHERE_SOURCE = $20000
MCI_OVLY_WHERE_DESTINATION = $40000
MCI_OVLY_WHERE_FRAME = $80000
MCI_OVLY_WHERE_VIDEO = $100000

struct MCIOVLYOPENPARMSA
       dwCallback dq ?
       wDeviceID dd ?
       lpstrDeviceType dq ?
       lpstrElementName dq ?
       lpstrAlias dq ?
       dwStyle dd ?
       hWndParent dq ?
ends

struct MCIOVLYOPENPARMSW
       dwCallback dq ?
       wDeviceID dd ?
       lpstrDeviceType dq ?
       lpstrElementName dq ?
       lpstrAlias dq ?
       dwStyle dd ?
       hWndParent dq ?
ends

struct MCIOVLYWINDOWPARMSA
       dwCallback dq ?
       hWnd dq ?
       nCmdShow dd ?
       lpstrText dq ?
ends

struct MCIOVLYWINDOWPARMSW
       dwCallback dq ?
       hWnd dq ?
       nCmdShow dd ?
       lpstrText dq ?
ends

struct MCIOVLYRECTPARMS
       dwCallback dq ?
       rc RECT
ends

struct MCIOVLYSAVEPARMSA
       dwCallback dq ?
       lpfilename dq ?
       rc RECT
ends

struct MCIOVLYSAVEPARMSW
       dwCallback dq ?
       lpfilename dq ?
       rc RECT
ends

struct MCIOVLYLOADPARMSA
       dwCallback dq ?
       lpfilename dq ?
       rc RECT
ends

struct MCIOVLYLOADPARMSW
       dwCallback dq ?
       lpfilename dq ?
       rc RECT
ends

NEWTRANSPARENT = 3
QUERYROPSUPPORT = 40
SELECTDIB = 41


;sspi.h, SubAuth.h, winhttp.h, winnetwk.h

;Microsoft Windows
;Copyright (C) Microsoft Corporation, 1992-1999.
;sspi.h
struct SECHANDLE
       dwLower dq ?
       dwUpper dq ?
ends

ISSP_LEVEL = 32
ISSP_MODE = 1

;SecInvalidateHandle( x ) = ((PSecHandle) x)->dwLower = ((ULONG_PTR) ((INT_PTR)-1))
;                           ((PSecHandle) x)->dwUpper = ((ULONG_PTR) ((INT_PTR)-1))

;SecIsValidHandle( x ) = ( ( ((PSecHandle) x)->dwLower != ((ULONG_PTR) ((INT_PTR) -1 ))) && \
;                        ( ((PSecHandle) x)->dwUpper != ((ULONG_PTR) ((INT_PTR) -1 ))) )

struct SECURITYINTEGER
       Lowpart dd ?
       HighPart dd ?
ends

struct SECURITYSTRING
       Length dw ?
       MaximumLength dd ?
       dw ?
       Buffer dq ?
ends

struct SECPKGINFOW
       fCapabilities dd ?
       wVersion dw ?
       wRPCID dw ?
       cbMaxToken dd ?,?
       Name dq ?
       Comment dq ?
ends

struct SECPKGINFOA
       fCapabilities dd ?
       wVersion dw ?
       wRPCID dw ?
       cbMaxToken dd ?,?
       Name dq ?
       Comment dq ?
ends

SECPKG_FLAG_INTEGRITY = 1
SECPKG_FLAG_PRIVACY = 2
SECPKG_FLAG_TOKEN_ONLY = 4
SECPKG_FLAG_DATAGRAM = 8
SECPKG_FLAG_CONNECTION = $10
SECPKG_FLAG_MULTI_REQUIRED = $20
SECPKG_FLAG_CLIENT_ONLY = $40
SECPKG_FLAG_EXTENDED_ERROR = $80
SECPKG_FLAG_IMPERSONATION = $100
SECPKG_FLAG_ACCEPT_WIN32_NAME = $200
SECPKG_FLAG_STREAM = $400
SECPKG_FLAG_NEGOTIABLE = $800
SECPKG_FLAG_GSS_COMPATIBLE = $1000
SECPKG_FLAG_LOGON = $2000
SECPKG_FLAG_ASCII_BUFFERS = $4000
SECPKG_FLAG_FRAGMENT = $8000
SECPKG_FLAG_MUTUAL_AUTH = $10000
SECPKG_FLAG_DELEGATION = $20000
SECPKG_FLAG_READONLY_WITH_CHECKSUM = $40000

SECPKG_ID_NONE = $FFFF

struct SECBUFFER
       cbBuffer dd ?
       BufferType dd ?
       pvBuffer dq ?
ends

struct SECBUFFERDESC
       ulVersion dd ?
       cBuffers dd ?
       pBuffers dq ?
ends

SECBUFFER_VERSION = 0
SECBUFFER_EMPTY = 0
SECBUFFER_DATA = 1
SECBUFFER_TOKEN = 2
SECBUFFER_PKG_PARAMS = 3
SECBUFFER_MISSING = 4
SECBUFFER_EXTRA = 5
SECBUFFER_STREAM_TRAILER = 6
SECBUFFER_STREAM_HEADER = 7
SECBUFFER_NEGOTIATION_INFO = 8
SECBUFFER_PADDING = 9
SECBUFFER_STREAM = 10
SECBUFFER_MECHLIST = 11
SECBUFFER_MECHLIST_SIGNATURE = 12
SECBUFFER_TARGET = 13
SECBUFFER_CHANNEL_BINDINGS = 14
SECBUFFER_ATTRMASK = $F0000000
SECBUFFER_READONLY = $80000000
SECBUFFER_READONLY_WITH_CHECKSUM = $10000000
SECBUFFER_RESERVED = $60000000

struct SECNEGOTIATIONINFO
       Size dd ?
       NameLength dd ?
       Name dq ?
       Reserved dq ?
ends

struct SECCHANNELBINDINGS
       dwInitiatorAddrType dd ?
       cbInitiatorLength dd ?
       dwInitiatorOffset dd ?
       dwAcceptorAddrType dd ?
       cbAcceptorLength dd ?
       dwAcceptorOffset dd ?
       cbApplicationDataLength dd ?
       dwApplicationDataOffset dd ?
ends

SECURITY_NATIVE_DREP = $10
SECURITY_NETWORK_DREP = 0
SECPKG_CRED_INBOUND = 1
SECPKG_CRED_OUTBOUND = 2
SECPKG_CRED_BOTH = 3
SECPKG_CRED_DEFAULT = 4
SECPKG_CRED_RESERVED = $F0000000

ISC_REQ_DELEGATE = 1
ISC_REQ_MUTUAL_AUTH = 2
ISC_REQ_REPLAY_DETECT = 4
ISC_REQ_SEQUENCE_DETECT = 8
ISC_REQ_CONFIDENTIALITY = $10
ISC_REQ_USE_SESSION_KEY = $20
ISC_REQ_PROMPT_FOR_CREDS = $40
ISC_REQ_USE_SUPPLIED_CREDS = $80
ISC_REQ_ALLOCATE_MEMORY = $100
ISC_REQ_USE_DCE_STYLE = $200
ISC_REQ_DATAGRAM = $400
ISC_REQ_CONNECTION = $800
ISC_REQ_CALL_LEVEL = $1000
ISC_REQ_FRAGMENT_SUPPLIED  = $2000
ISC_REQ_EXTENDED_ERROR = $4000
ISC_REQ_STREAM = $8000
ISC_REQ_INTEGRITY = $10000
ISC_REQ_IDENTIFY = $20000
ISC_REQ_NULL_SESSION = $40000
ISC_REQ_MANUAL_CRED_VALIDATION = $80000
ISC_REQ_RESERVED1 = $100000
ISC_REQ_FRAGMENT_TO_FIT = $200000

ISC_RET_DELEGATE = 1
ISC_RET_MUTUAL_AUTH = 2
ISC_RET_REPLAY_DETECT = 4
ISC_RET_SEQUENCE_DETECT = 8
ISC_RET_CONFIDENTIALITY = $10
ISC_RET_USE_SESSION_KEY = $20
ISC_RET_USED_COLLECTED_CREDS = $40
ISC_RET_USED_SUPPLIED_CREDS = $80
ISC_RET_ALLOCATED_MEMORY = $100
ISC_RET_USED_DCE_STYLE = $200
ISC_RET_DATAGRAM = $400
ISC_RET_CONNECTION = $800
ISC_RET_INTERMEDIATE_RETURN  = $1000
ISC_RET_CALL_LEVEL = $2000
ISC_RET_EXTENDED_ERROR = $4000
ISC_RET_STREAM = $8000
ISC_RET_INTEGRITY = $10000
ISC_RET_IDENTIFY = $20000
ISC_RET_NULL_SESSION = $40000
ISC_RET_MANUAL_CRED_VALIDATION	= $80000
ISC_RET_RESERVED1 = $100000
ISC_RET_FRAGMENT_ONLY = $200000

ASC_REQ_DELEGATE = 1
ASC_REQ_MUTUAL_AUTH = 2
ASC_REQ_REPLAY_DETECT = 4
ASC_REQ_SEQUENCE_DETECT = 8
ASC_REQ_CONFIDENTIALITY = $10
ASC_REQ_USE_SESSION_KEY = $20
ASC_REQ_ALLOCATE_MEMORY = $100
ASC_REQ_USE_DCE_STYLE = $200
ASC_REQ_DATAGRAM = $400
ASC_REQ_CONNECTION = $800
ASC_REQ_CALL_LEVEL = $1000
ASC_REQ_EXTENDED_ERROR = $8000
ASC_REQ_STREAM = $10000
ASC_REQ_INTEGRITY = $20000
ASC_REQ_LICENSING = $40000
ASC_REQ_IDENTIFY = $80000
ASC_REQ_ALLOW_NULL_SESSION = $100000
ASC_REQ_ALLOW_NON_USER_LOGONS = $200000
ASC_REQ_ALLOW_CONTEXT_REPLAY = $400000
ASC_REQ_FRAGMENT_TO_FIT = $800000
ASC_REQ_FRAGMENT_SUPPLIED = $2000
ASC_REQ_NO_TOKEN = $1000000

ASC_RET_DELEGATE = 1
ASC_RET_MUTUAL_AUTH = 2
ASC_RET_REPLAY_DETECT = 4
ASC_RET_SEQUENCE_DETECT = 8
ASC_RET_CONFIDENTIALITY = $10
ASC_RET_USE_SESSION_KEY = $20
ASC_RET_ALLOCATED_MEMORY = $100
ASC_RET_USED_DCE_STYLE = $200
ASC_RET_DATAGRAM = $400
ASC_RET_CONNECTION = $800
ASC_RET_CALL_LEVEL = $2000
ASC_RET_THIRD_LEG_FAILED = $4000
ASC_RET_EXTENDED_ERROR = $8000
ASC_RET_STREAM = $10000
ASC_RET_INTEGRITY = $20000
ASC_RET_LICENSING = $40000
ASC_RET_IDENTIFY = $80000
ASC_RET_NULL_SESSION = $100000
ASC_RET_ALLOW_NON_USER_LOGONS = $200000
ASC_RET_ALLOW_CONTEXT_REPLAY = $400000
ASC_RET_FRAGMENT_ONLY = $800000
ASC_RET_NO_TOKEN = $1000000

SECPKG_CRED_ATTR_NAMES = 1
SECPKG_CRED_ATTR_SSI_PROVIDER = 2

struct SECPKGCREDENTIALSNAMESW
       sUserName dq ?
ends

struct SECPKGCREDENTIALSNAMESA
       sUserName dq ?
ends

struct SECPKGCREDENTIALSSSIPROVIDERW
       sProviderName dq ?
       ProviderInfoLength dd ?,?
       ProviderInfo dq ?
ends

struct SECPKGCREDENTIALSSSIPROVIDERA
       sProviderName dq ?
       ProviderInfoLength dd ?,?
       ProviderInfo dq ?
ends

SECPKG_ATTR_SIZES = 0
SECPKG_ATTR_NAMES = 1
SECPKG_ATTR_LIFESPAN = 2
SECPKG_ATTR_DCE_INFO = 3
SECPKG_ATTR_STREAM_SIZES = 4
SECPKG_ATTR_KEY_INFO = 5
SECPKG_ATTR_AUTHORITY = 6
SECPKG_ATTR_PROTO_INFO = 7
SECPKG_ATTR_PASSWORD_EXPIRY = 8
SECPKG_ATTR_SESSION_KEY = 9
SECPKG_ATTR_PACKAGE_INFO = 10
SECPKG_ATTR_USER_FLAGS = 11
SECPKG_ATTR_NEGOTIATION_INFO = 12
SECPKG_ATTR_NATIVE_NAMES = 13
SECPKG_ATTR_FLAGS = 14
SECPKG_ATTR_USE_VALIDATED = 15
SECPKG_ATTR_CREDENTIAL_NAME = 16
SECPKG_ATTR_TARGET_INFORMATION = 17
SECPKG_ATTR_ACCESS_TOKEN = 18
SECPKG_ATTR_TARGET = 19
SECPKG_ATTR_AUTHENTICATION_ID = 20
SECPKG_ATTR_LOGOFF_TIME = 21

struct SECPKGCONTEXTSIZES
       cbMaxToken dd ?
       cbMaxSignature dd ?
       cbBlockSize dd ?
       cbSecurityTrailer dd ?
ends

struct SECPKGCONTEXTSTREAMSIZES
       cbHeader dd ?
       cbTrailer dd ?
       cbMaximumMessage dd ?
       cBuffers dd ?
       cbBlockSize dd ?
ends

struct SECPKGCONTEXTNAMESW
       sUserName dq ?
ends

struct SECPKGCONTEXTNAMESA
       sUserName dq ?
ends

struct SECPKGCONTEXTLIFESPAN
       tsStart dq ?
       tsExpiry dq ?
ends

struct SECPKGCONTEXTDCEINFO
       AuthzSvc dd ?,?
       pPac dq ?
ends

struct SECPKGCONTEXTKEYINFOA
       sSignatureAlgorithmName dq ?
       sEncryptAlgorithmName dq ?
       KeySize dd ?
       SignatureAlgorithm dd ?
       EncryptAlgorithm dd ?,?
ends

struct SECPKGCONTEXTKEYINFOW
       sSignatureAlgorithmName dq ?
       sEncryptAlgorithmName dq ?
       KeySize dd ?
       SignatureAlgorithm dd ?
       EncryptAlgorithm dd ?,?
ends

struct SECPKGCONTEXTAUTHORITYA
       sAuthorityName dq ?
ends

struct SECPKGCONTEXTAUTHORITYW
       sAuthorityName dq ?
ends

struct SECPKGCONTEXTPROTOINFOA
       sProtocolName dq ?
       majorVersion dd ?
       minorVersion dd ?
ends

struct SECPKGCONTEXTPROTOINFOW
       sProtocolName dq ?
       majorVersion dd ?
       minorVersion dd ?
ends

struct SECPKGCONTEXTPASSWORDEXPIRY
       tsPasswordExpires dq ?
ends

struct SECPKGCONTEXTLOGOFFTIME
       tsLogoffTime dq ?
ends

struct SECPKGCONTEXTSESSIONKEY
       SessionKeyLength dd ?,?
       SessionKey dq ?
ends

struct SECPKGCONTEXTPACKAGEINFOW
       PackageInfo dq ?
ends

struct SECPKGCONTEXTPACKAGEINFOA
       PackageInfo dq ?
ends

struct SECPKGCONTEXTUSERFLAGS
       UserFlags dd ?
ends

struct SECPKGCONTEXTFLAGS
       Flags dd ?
ends

struct SECPKGCONTEXTNEGOTIATIONINFOA
       PackageInfo dq ?
       NegotiationState dd ?,?
ends

struct SECPKGCONTEXTNEGOTIATIONINFOW
       PackageInfo dq ?
       NegotiationState dd ?,?
ends

SECPKG_NEGOTIATION_COMPLETE = 0
SECPKG_NEGOTIATION_OPTIMISTIC = 1
SECPKG_NEGOTIATION_IN_PROGRESS = 2
SECPKG_NEGOTIATION_DIRECT = 3
SECPKG_NEGOTIATION_TRY_MULTICRED = 4

struct SECPKGCONTEXTNATIVENAMESW
       sClientName dq ?
       sServerName dq ?
ends

struct SECPKGCONTEXTNATIVENAMESA
       sClientName dq ?
       sServerName dq ?
ends

struct SECPKGCONTEXTCREDENTIALNAMEW
       CredentialType dd ?,?
       sCredentialName dq ?
ends

struct SECPKGCONTEXTCREDENTIALNAMEA
       CredentialType dd ?,?
       sCredentialName dq ?
ends

struct SECPKGCONTEXTACCESSTOKEN
       AccessToken dq ?
ends

struct SECPKGCONTEXTTARGETINFORMATION
       MarshalledTargetInfoLength dd ?,?
       MarshalledTargetInfo dq ?
ends

struct SECPKGCONTEXTAUTHZID
       AuthzIDLength dd ?,?
       AuthzID dq ?
ends

struct SECPKGCONTEXTTARGET
       TargetLength dd ?,?
       Target dq ?
ends

SECPKG_CONTEXT_EXPORT_RESET_NEW = 1
SECPKG_CONTEXT_EXPORT_DELETE_OLD = 2
SECPKG_CONTEXT_EXPORT_TO_KERNEL = 4

SecFull = 0
SecService = 1
SecTree = 2
SecDirectory = 3
SecObject = 4

SECURITY_ENTRYPOINT_ANSIW equ "InitSecurityInterfaceW"
SECURITY_ENTRYPOINT_ANSIA equ "InitSecurityInterfaceA"
SECURITY_ENTRYPOINTW equ "InitSecurityInterfaceW"
SECURITY_ENTRYPOINTA equ "InitSecurityInterfaceA"
SECURITY_ENTRYPOINT16 equ "INITSECURITYINTERFACEA"

struct SECURITYFUNCTIONTABLEW
       dwVersion dd ?,?
       EnumerateSecurityPackagesW dq ?
       QueryCredentialsAttributesW dq ?
       AcquireCredentialsHandleW dq ?
       FreeCredentialsHandle dq ?
       Reserved2 dq ?
       InitializeSecurityContextW dq ?
       AcceptSecurityContext dq ?
       CompleteAuthToken dq ?
       DeleteSecurityContext dq ?
       ApplyControlToken dq ?
       QueryContextAttributesW dq ?
       ImpersonateSecurityContext dq ?
       RevertSecurityContext dq ?
       MakeSignature dq ?
       VerifySignature dq ?
       FreeContextBuffer dq ?
       QuerySecurityPackageInfoW dq ?
       Reserved3 dq ?
       Reserved4 dq ?
       ExportSecurityContext dq ?
       ImportSecurityContextW dq ?
       AddCredentialsW dq ?
       Reserved8 dq ?
       QuerySecurityContextToken dq ?
       EncryptMessage dq ?
       DecryptMessage dq ?
       SetContextAttributesW dq ?
       SetCredentialsAttributesW dq ?
       ChangeAccountPasswordW dq ?
ends

struct SECURITYFUNCTIONTABLEA
       dwVersion dd ?,?
       EnumerateSecurityPackagesA dq ?
       QueryCredentialsAttributesA dq ?
       AcquireCredentialsHandleA dq ?
       FreeCredentialHandle dq ?
       Reserved2 dq ?
       InitializeSecurityContextA dq ?
       AcceptSecurityContext dq ?
       CompleteAuthToken dq ?
       DeleteSecurityContext dq ?
       ApplyControlToken dq ?
       QueryContextAttributesA dq ?
       ImpersonateSecurityContext dq ?
       RevertSecurityContext dq ?
       MakeSignature dq ?
       VerifySignature dq ?
       FreeContextBuffer dq ?
       QuerySecurityPackageInfoA dq ?
       Reserved3 dq ?
       Reserved4 dq ?
       ExportSecurityContext dq ?
       ImportSecurityContextA dq ?
       AddCredentialsA dq ?
       Reserved8 dq ?
       QuerySecurityContextToken dq ?
       EncryptMessage dq ?
       DecryptMessage dq ?
       SetContextAttributesA dq ?
       SetCredentialsAttributesA dq ?
       ChangeAccountPasswordA dq ?
ends

SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION = 1
SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_2 = 2
SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_3 = 3

SASL_OPTION_SEND_SIZE = 1
SASL_OPTION_RECV_SIZE = 2
SASL_OPTION_AUTHZ_STRING = 3
SASL_OPTION_AUTHZ_PROCESSING = 4

Sasl_AuthZIDForbidden = 0
Sasl_AuthZIDProcessed = 1

SEC_WINNT_AUTH_IDENTITY_ANSI = 1
SEC_WINNT_AUTH_IDENTITY_UNICODE = 2

struct SECWINNTAUTHIDENTITYEXW
       Version dd ?
       Length dd ?
       User dq ?
       UserLength dd ?,?
       Domain dq ?
       DomainLength dd ?,?
       Password dq ?
       PasswordLength dd ?
       Flags dd ?
       PackageList dq ?
       PackageListLength dd ?,?
ends

struct SECWINNTAUTHIDENTITYEXA
       Version dd ?
       Length dd ?
       User dq ?
       UserLength dd ?,?
       Domain dq ?
       DomainLength dd ?,?
       Password dq ?
       PasswordLength dd ?
       Flags dd ?
       PackageList dq ?
       PackageListLength dd ?,?
ends

SEC_WINNT_AUTH_IDENTITY_MARSHALLED = 4
SEC_WINNT_AUTH_IDENTITY_ONLY = 8

struct SECURITYPACKAGEOPTIONS
       Size dd ?
       Type dd ?
       Flags dd ?
       SignatureSize dd ?
       Signature dq ?
ends

SECPKG_OPTIONS_TYPE_UNKNOWN = 0
SECPKG_OPTIONS_TYPE_LSA = 1
SECPKG_OPTIONS_TYPE_SSPI = 2
SECPKG_OPTIONS_PERMANENT = 1

;BUILD Version: 0005     Increment this if a change has global effects
;Copyright (c) Microsoft Corporation. All rights reserved.
;subauth.h

struct OLDLARGEINTEGER
       LowPart dd ?
       HighPart dd ?
ends

USER_ACCOUNT_DISABLED = 1
USER_HOME_DIRECTORY_REQUIRED = 2
USER_PASSWORD_NOT_REQUIRED = 4
USER_TEMP_DUPLICATE_ACCOUNT = 8
USER_NORMAL_ACCOUNT = $10
USER_MNS_LOGON_ACCOUNT = $20
USER_INTERDOMAIN_TRUST_ACCOUNT = $40
USER_WORKSTATION_TRUST_ACCOUNT = $80
USER_SERVER_TRUST_ACCOUNT = $100
USER_DONT_EXPIRE_PASSWORD = $200
USER_ACCOUNT_AUTO_LOCKED = $400
USER_ENCRYPTED_TEXT_PASSWORD_ALLOWED = $800
USER_SMARTCARD_REQUIRED = $1000
USER_TRUSTED_FOR_DELEGATION = $2000
USER_NOT_DELEGATED = $4000
USER_USE_DES_KEY_ONLY = $8000
USER_DONT_REQUIRE_PREAUTH = $10000
USER_PASSWORD_EXPIRED = $20000
USER_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION = $40000
USER_NO_AUTH_DATA_REQUIRED = $80000
NEXT_FREE_ACCOUNT_CONTROL_BIT = (USER_NO_AUTH_DATA_REQUIRED shl 1)


USER_MACHINE_ACCOUNT_MASK = USER_INTERDOMAIN_TRUST_ACCOUNT or USER_WORKSTATION_TRUST_ACCOUNT or\
			     USER_SERVER_TRUST_ACCOUNT

USER_ACCOUNT_TYPE_MASK = USER_TEMP_DUPLICATE_ACCOUNT or USER_NORMAL_ACCOUNT or\
			 USER_MACHINE_ACCOUNT_MASK

USER_COMPUTED_ACCOUNT_CONTROL_BITS = (USER_ACCOUNT_AUTO_LOCKED or USER_PASSWORD_EXPIRED)

SAM_DAYS_PER_WEEK = 7
SAM_HOURS_PER_WEEK = 24 * SAM_DAYS_PER_WEEK
SAM_MINUTES_PER_WEEK = 60 * SAM_HOURS_PER_WEEK

struct LOGONHOURS
       UnitsPerWeek dw ?,?,?,?
       LogonHours dq ?
ends

struct SRSECURITYDESCRIPTOR
       Length dd ?,?
       SecurityDescriptor dq ?
ends

struct USERALLINFORMATION
       LastLogon dq ?
       LastLogoff dq ?
       PasswordLastSet dq ?
       AccountExpires dq ?
       PasswordCanChange dq ?
       PasswordMustChange dq ?
       UserName UNICODESTRING
       FullName UNICODESTRING
       HomeDirectory UNICODESTRING
       HomeDirectoryDrive UNICODESTRING
       ScriptPath UNICODESTRING
       ProfilePath UNICODESTRING
       AdminComment UNICODESTRING
       WorkStations UNICODESTRING
       UserComment UNICODESTRING
       Parameters UNICODESTRING
       LmPassword UNICODESTRING
       NtPassword UNICODESTRING
       PrivateData UNICODESTRING
       SecurityDescriptor SRSECURITYDESCRIPTOR
       UserId dd ?
       PrimaryGroupId dd ?
       UserAccountControl dd ?
       WhichFields dd ?
       LogonHours LOGONHOURS
       BadPasswordCount dw ?
       LogonCount dw ?
       CountryCode dw ?
       CodePage dw ?
       LmPasswordPresent db ?
       NtPasswordPresent db ?
       PasswordExpired db ?
       PrivateDataSensitive db ?
ends

USER_ALL_PARAMETERS = $200000

CLEAR_BLOCK_LENGTH = 8

struct CLEARBLOCK
       data db CLEAR_BLOCK_LENGTH dup(?)
ends

CYPHER_BLOCK_LENGTH = 8

struct CYPHERBLOCK
       data db CYPHER_BLOCK_LENGTH dup(?)
ends

struct LMOWFPASSWORD
       data CYPHERBLOCK
	    db sizeof.CYPHERBLOCK dup(?)
ends

USER_SESSION_KEY_LENGTH = CYPHER_BLOCK_LENGTH * 2

struct USERSESSIONKEY
       data CYPHERBLOCK
	    db sizeof.CYPHERBLOCK dup(?)
ends

NetlogonInteractiveInformation = 1
NetlogonNetworkInformation = 2
NetlogonServiceInformation = 3
NetlogonGenericInformation = 4
NetlogonInteractiveTransitiveInformation = 5
NetlogonNetworkTransitiveInformation = 6
NetlogonServiceTransitiveInformation = 7

struct NETLOGONLOGONIDENTITYINFO
       LogonDomainName UNICODESTRING
       ParameterControl dd ?
       LogonId OLDLARGEINTEGER
       UserName UNICODESTRING
       Workstation UNICODESTRING
       dd ?
ends

struct NETLOGONINTERACTIVEINFO
       Identity NETLOGONLOGONIDENTITYINFO
       LmOwfPassword LMOWFPASSWORD
       NtOwfPassword LMOWFPASSWORD
ends


struct NETLOGONSERVICEINFO
       Identity NETLOGONLOGONIDENTITYINFO
       LmOwfPassword LMOWFPASSWORD
       NtOwfPassword LMOWFPASSWORD
ends

struct NETLOGONNETWORKINFO
       Identity NETLOGONLOGONIDENTITYINFO
       LmChallenge dq ?
       NtChallengeResponse STRING
       LmChallengeResponse STRING
ends

struct NETLOGONGENERICINFO
       Identity NETLOGONLOGONIDENTITYINFO
       PackageName UNICODESTRING
       DataLength dd ?,?
       LogonData dq ?
ends

MSV1_0_PASSTHRU = 1
MSV1_0_GUEST_LOGON = 2

struct MSV10VALIDATIONINFO
       LogoffTime OLDLARGEINTEGER
       KickoffTime OLDLARGEINTEGER
       LogonServer UNICODESTRING
       LogonDomainName UNICODESTRING
       SessionKey USERSESSIONKEY
       Authoritative db ?
       UserFlags dd ?
       WhichFields dd ?
       UserId dd ?
       db ?,?,?
ends

MSV1_0_VALIDATION_LOGOFF_TIME = 1
MSV1_0_VALIDATION_KICKOFF_TIME = 2
MSV1_0_VALIDATION_LOGON_SERVER = 4
MSV1_0_VALIDATION_LOGON_DOMAIN = 8
MSV1_0_VALIDATION_SESSION_KEY = $10
MSV1_0_VALIDATION_USER_FLAGS = $20
MSV1_0_VALIDATION_USER_ID = $40

MSV1_0_SUBAUTH_ACCOUNT_DISABLED = 1
MSV1_0_SUBAUTH_PASSWORD = 2
MSV1_0_SUBAUTH_WORKSTATIONS = 4
MSV1_0_SUBAUTH_LOGON_HOURS = 8
MSV1_0_SUBAUTH_ACCOUNT_EXPIRY = $10
MSV1_0_SUBAUTH_PASSWORD_EXPIRY = $20
MSV1_0_SUBAUTH_ACCOUNT_TYPE = $40
MSV1_0_SUBAUTH_LOCKOUT = $80

STATUS_SUCCESS = 0
STATUS_INVALID_INFO_CLASS = $C0000003
STATUS_NO_SUCH_USER = $C0000064
STATUS_WRONG_PASSWORD = $C000006A
STATUS_PASSWORD_RESTRICTION = $C000006C
STATUS_LOGON_FAILURE = $C000006D
STATUS_ACCOUNT_RESTRICTION = $C000006E
STATUS_INVALID_LOGON_HOURS = $C000006F
STATUS_INVALID_WORKSTATION = $C0000070
STATUS_PASSWORD_EXPIRED = $C0000071
STATUS_ACCOUNT_DISABLED = $C0000072
STATUS_INSUFFICIENT_RESOURCES = $C000009A
STATUS_ACCOUNT_EXPIRED = $C0000193
STATUS_PASSWORD_MUST_CHANGE = $C0000224
STATUS_ACCOUNT_LOCKED_OUT = $C0000234

;Copyright (c) Microsoft Corporation. All rights reserved.
;Module Name: winhttp.h
;Contains manifests, macros, types and prototypes for Windows HTTP Services

INTERNET_DEFAULT_PORT = 0
INTERNET_DEFAULT_HTTP_PORT = $80
INTERNET_DEFAULT_HTTPS_PORT = $443

WINHTTP_FLAG_ASYNC = $10000000
WINHTTP_FLAG_SECURE = $800000
WINHTTP_FLAG_ESCAPE_PERCENT = 4
WINHTTP_FLAG_NULL_CODEPAGE = 8
WINHTTP_FLAG_BYPASS_PROXY_CACHE = $100
WINHTTP_FLAG_REFRESH = WINHTTP_FLAG_BYPASS_PROXY_CACHE
WINHTTP_FLAG_ESCAPE_DISABLE = $40
WINHTTP_FLAG_ESCAPE_DISABLE_QUERY = $80

SECURITY_FLAG_IGNORE_UNKNOWN_CA = $100
SECURITY_FLAG_IGNORE_CERT_DATE_INVALID = $2000
SECURITY_FLAG_IGNORE_CERT_CN_INVALID = $1000
SECURITY_FLAG_IGNORE_CERT_WRONG_USAGE = $200

struct WINHTTPASYNCRESULT
       dwResult dq ?
       dwError dd ?,?
ends

struct HTTPVERSIONINFO
       dwMajorVersion dd ?
       dwMinorVersion dd ?
ends

INTERNET_SCHEME_HTTP = 1
INTERNET_SCHEME_HTTPS = 2

struct WINHTTPPROXYINFO
       dwAccessType dd ?,?
       lpszProxy dq ?
       lpszProxyBypass dq ?
ends

struct WINHTTPAUTOPROXYOPTIONS
       dwFlags dd ?
       dwAutoDetectFlags dd ?
       lpszAutoConfigUrl dq ?
       lpvReserved dq ?
       dwReserved dd ?
       fAutoLogonIfChallenged dd ?
ends

WINHTTP_AUTOPROXY_AUTO_DETECT = 1
WINHTTP_AUTOPROXY_CONFIG_URL = 2
WINHTTP_AUTOPROXY_RUN_INPROCESS = $10000
WINHTTP_AUTOPROXY_RUN_OUTPROCESS_ONLY = $20000
WINHTTP_AUTO_DETECT_TYPE_DHCP = 1
WINHTTP_AUTO_DETECT_TYPE_DNS_A = 2

struct WINHTTPCERTIFICATEINFO
       ftExpiry FILETIME
       ftStart FILETIME
       lpszSubjectInfo dq ?
       lpszIssuerInfo dq ?
       lpszProtocolName dq ?
       lpszSignatureAlgName dq ?
       lpszEncryptionAlgName dq ?
       dwKeySize dd ?,?
ends

WINHTTP_TIME_FORMAT_BUFSIZE = 62

ICU_NO_ENCODE = $20000000
ICU_DECODE = $10000000
ICU_NO_META = $8000000
ICU_ENCODE_SPACES_ONLY = $4000000
ICU_BROWSER_MODE = $2000000
ICU_ENCODE_PERCENT = $1000
ICU_ESCAPE = $80000000

WINHTTP_ACCESS_TYPE_DEFAULT_PROXY = 0
WINHTTP_ACCESS_TYPE_NO_PROXY = 1
WINHTTP_ACCESS_TYPE_NAMED_PROXY = 3
WINHTTP_NO_PROXY_NAME = NULL
WINHTTP_NO_PROXY_BYPASS = NULL
WINHTTP_FIRST_OPTION = WINHTTP_OPTION_CALLBACK
WINHTTP_OPTION_CALLBACK = 1
WINHTTP_OPTION_RESOLVE_TIMEOUT = 2
WINHTTP_OPTION_CONNECT_TIMEOUT = 3
WINHTTP_OPTION_CONNECT_RETRIES = 4
WINHTTP_OPTION_SEND_TIMEOUT = 5
WINHTTP_OPTION_RECEIVE_TIMEOUT = 6
WINHTTP_OPTION_RECEIVE_RESPONSE_TIMEOUT = 7
WINHTTP_OPTION_HANDLE_TYPE = 9
WINHTTP_OPTION_READ_BUFFER_SIZE = 12
WINHTTP_OPTION_WRITE_BUFFER_SIZE = 13
WINHTTP_OPTION_PARENT_HANDLE = 21
WINHTTP_OPTION_EXTENDED_ERROR = 24
WINHTTP_OPTION_SECURITY_FLAGS = 31
WINHTTP_OPTION_SECURITY_CERTIFICATE_STRUCT   = 32
WINHTTP_OPTION_URL = 34
WINHTTP_OPTION_SECURITY_KEY_BITNESS = 36
WINHTTP_OPTION_PROXY = 38
WINHTTP_OPTION_USER_AGENT = 41
WINHTTP_OPTION_CONTEXT_VALUE = 45
WINHTTP_OPTION_CLIENT_CERT_CONTEXT = 47
WINHTTP_OPTION_REQUEST_PRIORITY = 58
WINHTTP_OPTION_HTTP_VERSION = 59
WINHTTP_OPTION_DISABLE_FEATURE	= 63
WINHTTP_OPTION_CODEPAGE = 68
WINHTTP_OPTION_MAX_CONNS_PER_SERVER = 73
WINHTTP_OPTION_MAX_CONNS_PER_1_0_SERVER = 74
WINHTTP_OPTION_AUTOLOGON_POLICY = 77
WINHTTP_OPTION_SERVER_CERT_CONTEXT = 78
WINHTTP_OPTION_ENABLE_FEATURE = 79
WINHTTP_OPTION_WORKER_THREAD_COUNT = 80
WINHTTP_OPTION_PASSPORT_COBRANDING_TEXT = 81
WINHTTP_OPTION_PASSPORT_COBRANDING_URL = 82
WINHTTP_OPTION_CONFIGURE_PASSPORT_AUTH = 83
WINHTTP_OPTION_SECURE_PROTOCOLS = 84
WINHTTP_OPTION_ENABLETRACING = 85
WINHTTP_OPTION_PASSPORT_SIGN_OUT = 86
WINHTTP_OPTION_PASSPORT_RETURN_URL = 87
WINHTTP_OPTION_REDIRECT_POLICY = 88
WINHTTP_OPTION_MAX_HTTP_AUTOMATIC_REDIRECTS  = 89
WINHTTP_OPTION_MAX_HTTP_STATUS_CONTINUE = 90
WINHTTP_OPTION_MAX_RESPONSE_HEADER_SIZE = 91
WINHTTP_OPTION_MAX_RESPONSE_DRAIN_SIZE = 92
WINHTTP_LAST_OPTION = WINHTTP_OPTION_MAX_RESPONSE_DRAIN_SIZE
WINHTTP_OPTION_USERNAME = $1000
WINHTTP_OPTION_PASSWORD = $1001
WINHTTP_OPTION_PROXY_USERNAME = $1002
WINHTTP_OPTION_PROXY_PASSWORD = $1003
WINHTTP_CONNS_PER_SERVER_UNLIMITED = $FFFFFFFF
WINHTTP_AUTOLOGON_SECURITY_LEVEL_MEDIUM = 0
WINHTTP_AUTOLOGON_SECURITY_LEVEL_LOW = 1
WINHTTP_AUTOLOGON_SECURITY_LEVEL_HIGH = 2
WINHTTP_AUTOLOGON_SECURITY_LEVEL_DEFAULT = WINHTTP_AUTOLOGON_SECURITY_LEVEL_MEDIUM
WINHTTP_OPTION_REDIRECT_POLICY_NEVER = 0
WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP = 1
WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS = 2
WINHTTP_OPTION_REDIRECT_POLICY_LAST = WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS
WINHTTP_OPTION_REDIRECT_POLICY_DEFAULT = WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP
WINHTTP_DISABLE_PASSPORT_AUTH = 0
WINHTTP_ENABLE_PASSPORT_AUTH = $10000000
WINHTTP_DISABLE_PASSPORT_KEYRING = $20000000
WINHTTP_ENABLE_PASSPORT_KEYRING = $40000000
WINHTTP_DISABLE_COOKIES = 1
WINHTTP_DISABLE_REDIRECTS = 2
WINHTTP_DISABLE_AUTHENTICATION = 4
WINHTTP_DISABLE_KEEP_ALIVE = 8
WINHTTP_ENABLE_SSL_REVOCATION = 1
WINHTTP_ENABLE_SSL_REVERT_IMPERSONATION = 2
WINHTTP_HANDLE_TYPE_SESSION = 1
WINHTTP_HANDLE_TYPE_CONNECT = 2
WINHTTP_HANDLE_TYPE_REQUEST = 3
WINHTTP_AUTH_SCHEME_BASIC = 1
WINHTTP_AUTH_SCHEME_NTLM = 2
WINHTTP_AUTH_SCHEME_PASSPORT = 4
WINHTTP_AUTH_SCHEME_DIGEST = 8
WINHTTP_AUTH_SCHEME_NEGOTIATE = $10
WINHTTP_AUTH_TARGET_SERVER = 0
WINHTTP_AUTH_TARGET_PROXY = 1

SECURITY_FLAG_SECURE = 1
SECURITY_FLAG_STRENGTH_WEAK = $10000000
SECURITY_FLAG_STRENGTH_MEDIUM = $40000000
SECURITY_FLAG_STRENGTH_STRONG = $20000000

WINHTTP_CALLBACK_STATUS_FLAG_CERT_REV_FAILED = 1
WINHTTP_CALLBACK_STATUS_FLAG_INVALID_CERT = 2
WINHTTP_CALLBACK_STATUS_FLAG_CERT_REVOKED = 4
WINHTTP_CALLBACK_STATUS_FLAG_INVALID_CA = 8
WINHTTP_CALLBACK_STATUS_FLAG_CERT_CN_INVALID = $10
WINHTTP_CALLBACK_STATUS_FLAG_CERT_DATE_INVALID = $20
WINHTTP_CALLBACK_STATUS_FLAG_CERT_WRONG_USAGE = $40
WINHTTP_CALLBACK_STATUS_FLAG_SECURITY_CHANNEL_ERROR = $80000000
WINHTTP_FLAG_SECURE_PROTOCOL_SSL2 = 8
WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 = $20
WINHTTP_FLAG_SECURE_PROTOCOL_TLS1 = $80
WINHTTP_FLAG_SECURE_PROTOCOL_ALL = (WINHTTP_FLAG_SECURE_PROTOCOL_SSL2 or\
				    WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 or\
				    WINHTTP_FLAG_SECURE_PROTOCOL_TLS1)

WINHTTP_CALLBACK_STATUS_RESOLVING_NAME = 1
WINHTTP_CALLBACK_STATUS_NAME_RESOLVED = 2
WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER = 4
WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER = 8
WINHTTP_CALLBACK_STATUS_SENDING_REQUEST = $10
WINHTTP_CALLBACK_STATUS_REQUEST_SENT = $20
WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE = $40
WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED = $80
WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION = $100
WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED = $200
WINHTTP_CALLBACK_STATUS_HANDLE_CREATED = $400
WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING = $800
WINHTTP_CALLBACK_STATUS_DETECTING_PROXY = $1000
WINHTTP_CALLBACK_STATUS_REDIRECT = $4000
WINHTTP_CALLBACK_STATUS_INTERMEDIATE_RESPONSE = $8000
WINHTTP_CALLBACK_STATUS_SECURE_FAILURE = $10000
WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE = $20000
WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE = $40000
WINHTTP_CALLBACK_STATUS_READ_COMPLETE = $80000
WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE = $100000
WINHTTP_CALLBACK_STATUS_REQUEST_ERROR = $200000
WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE = $400000

API_RECEIVE_RESPONSE = 1
API_QUERY_DATA_AVAILABLE = 2
API_READ_DATA = 3
API_WRITE_DATA = 4
API_SEND_REQUEST = 5

WINHTTP_CALLBACK_FLAG_RESOLVE_NAME = (WINHTTP_CALLBACK_STATUS_RESOLVING_NAME or WINHTTP_CALLBACK_STATUS_NAME_RESOLVED)
WINHTTP_CALLBACK_FLAG_CONNECT_TO_SERVER = (WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER or WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER)
WINHTTP_CALLBACK_FLAG_SEND_REQUEST = (WINHTTP_CALLBACK_STATUS_SENDING_REQUEST or WINHTTP_CALLBACK_STATUS_REQUEST_SENT)
WINHTTP_CALLBACK_FLAG_RECEIVE_RESPONSE = (WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE or WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED)
WINHTTP_CALLBACK_FLAG_CLOSE_CONNECTION = (WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION or WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED)
WINHTTP_CALLBACK_FLAG_HANDLES = (WINHTTP_CALLBACK_STATUS_HANDLE_CREATED or WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING)
WINHTTP_CALLBACK_FLAG_DETECTING_PROXY = WINHTTP_CALLBACK_STATUS_DETECTING_PROXY
WINHTTP_CALLBACK_FLAG_REDIRECT = WINHTTP_CALLBACK_STATUS_REDIRECT
WINHTTP_CALLBACK_FLAG_INTERMEDIATE_RESPONSE = WINHTTP_CALLBACK_STATUS_INTERMEDIATE_RESPONSE
WINHTTP_CALLBACK_FLAG_SECURE_FAILURE = WINHTTP_CALLBACK_STATUS_SECURE_FAILURE
WINHTTP_CALLBACK_FLAG_SENDREQUEST_COMPLETE = WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE
WINHTTP_CALLBACK_FLAG_HEADERS_AVAILABLE = WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE
WINHTTP_CALLBACK_FLAG_DATA_AVAILABLE = WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE
WINHTTP_CALLBACK_FLAG_READ_COMPLETE = WINHTTP_CALLBACK_STATUS_READ_COMPLETE
WINHTTP_CALLBACK_FLAG_WRITE_COMPLETE = WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE
WINHTTP_CALLBACK_FLAG_REQUEST_ERROR = WINHTTP_CALLBACK_STATUS_REQUEST_ERROR


WINHTTP_CALLBACK_FLAG_ALL_COMPLETIONS = (WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE\
					 or WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE\
					 or WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE\
					 or WINHTTP_CALLBACK_STATUS_READ_COMPLETE\
					 or WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE\
					 or WINHTTP_CALLBACK_STATUS_REQUEST_ERROR)

WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS = $ffffffff
WINHTTP_INVALID_STATUS_CALLBACK = -1
WINHTTP_QUERY_MIME_VERSION = 0
WINHTTP_QUERY_CONTENT_TYPE = 1
WINHTTP_QUERY_CONTENT_TRANSFER_ENCODING = 2
WINHTTP_QUERY_CONTENT_ID = 3
WINHTTP_QUERY_CONTENT_DESCRIPTION = 4
WINHTTP_QUERY_CONTENT_LENGTH = 5
WINHTTP_QUERY_CONTENT_LANGUAGE = 6
WINHTTP_QUERY_ALLOW = 7
WINHTTP_QUERY_PUBLIC = 8
WINHTTP_QUERY_DATE = 9
WINHTTP_QUERY_EXPIRES = 10
WINHTTP_QUERY_LAST_MODIFIED = 11
WINHTTP_QUERY_MESSAGE_ID = 12
WINHTTP_QUERY_URI = 13
WINHTTP_QUERY_DERIVED_FROM = 14
WINHTTP_QUERY_COST = 15
WINHTTP_QUERY_LINK = 16
WINHTTP_QUERY_PRAGMA = 17
WINHTTP_QUERY_VERSION = 18
WINHTTP_QUERY_STATUS_CODE = 19
WINHTTP_QUERY_STATUS_TEXT = 20
WINHTTP_QUERY_RAW_HEADERS = 21
WINHTTP_QUERY_RAW_HEADERS_CRLF = 22
WINHTTP_QUERY_CONNECTION = 23
WINHTTP_QUERY_ACCEPT = 24
WINHTTP_QUERY_ACCEPT_CHARSET = 25
WINHTTP_QUERY_ACCEPT_ENCODING = 26
WINHTTP_QUERY_ACCEPT_LANGUAGE = 27
WINHTTP_QUERY_AUTHORIZATION = 28
WINHTTP_QUERY_CONTENT_ENCODING = 29
WINHTTP_QUERY_FORWARDED = 30
WINHTTP_QUERY_FROM = 31
WINHTTP_QUERY_IF_MODIFIED_SINCE = 32
WINHTTP_QUERY_LOCATION = 33
WINHTTP_QUERY_ORIG_URI = 34
WINHTTP_QUERY_REFERER = 35
WINHTTP_QUERY_RETRY_AFTER = 36
WINHTTP_QUERY_SERVER = 37
WINHTTP_QUERY_TITLE = 38
WINHTTP_QUERY_USER_AGENT = 39
WINHTTP_QUERY_WWW_AUTHENTICATE = 40
WINHTTP_QUERY_PROXY_AUTHENTICATE = 41
WINHTTP_QUERY_ACCEPT_RANGES = 42
WINHTTP_QUERY_SET_COOKIE = 43
WINHTTP_QUERY_COOKIE = 44
WINHTTP_QUERY_REQUEST_METHOD = 45
WINHTTP_QUERY_REFRESH = 46
WINHTTP_QUERY_CONTENT_DISPOSITION  = 47
WINHTTP_QUERY_AGE = 48
WINHTTP_QUERY_CACHE_CONTROL = 49
WINHTTP_QUERY_CONTENT_BASE = 50
WINHTTP_QUERY_CONTENT_LOCATION = 51
WINHTTP_QUERY_CONTENT_MD5 = 52
WINHTTP_QUERY_CONTENT_RANGE = 53
WINHTTP_QUERY_ETAG = 54
WINHTTP_QUERY_HOST = 55
WINHTTP_QUERY_IF_MATCH = 56
WINHTTP_QUERY_IF_NONE_MATCH = 57
WINHTTP_QUERY_IF_RANGE = 58
WINHTTP_QUERY_IF_UNMODIFIED_SINCE = 59
WINHTTP_QUERY_MAX_FORWARDS = 60
WINHTTP_QUERY_PROXY_AUTHORIZATION = 61
WINHTTP_QUERY_RANGE = 62
WINHTTP_QUERY_TRANSFER_ENCODING = 63
WINHTTP_QUERY_UPGRADE = 64
WINHTTP_QUERY_VARY = 65
WINHTTP_QUERY_VIA = 66
WINHTTP_QUERY_WARNING = 67
WINHTTP_QUERY_EXPECT = 68
WINHTTP_QUERY_PROXY_CONNECTION = 69
WINHTTP_QUERY_UNLESS_MODIFIED_SINCE = 70
WINHTTP_QUERY_PROXY_SUPPORT = 75
WINHTTP_QUERY_AUTHENTICATION_INFO = 76
WINHTTP_QUERY_PASSPORT_URLS = 77
WINHTTP_QUERY_PASSPORT_CONFIG = 78
WINHTTP_QUERY_MAX = 78
WINHTTP_QUERY_CUSTOM = 65535
WINHTTP_QUERY_FLAG_REQUEST_HEADERS = 80000000
WINHTTP_QUERY_FLAG_SYSTEMTIME = $40000000
WINHTTP_QUERY_FLAG_NUMBER = $20000000

HTTP_STATUS_CONTINUE = 100
HTTP_STATUS_SWITCH_PROTOCOLS = 101
HTTP_STATUS_OK = 200
HTTP_STATUS_CREATED = 201
HTTP_STATUS_ACCEPTED = 202
HTTP_STATUS_PARTIAL = 203
HTTP_STATUS_NO_CONTENT = 204
HTTP_STATUS_RESET_CONTENT = 205
HTTP_STATUS_PARTIAL_CONTENT = 206
HTTP_STATUS_WEBDAV_MULTI_STATUS = 207
HTTP_STATUS_AMBIGUOUS = 300
HTTP_STATUS_MOVED = 301
HTTP_STATUS_REDIRECT = 302
HTTP_STATUS_REDIRECT_METHOD = 303
HTTP_STATUS_NOT_MODIFIED = 304
HTTP_STATUS_USE_PROXY = 305
HTTP_STATUS_REDIRECT_KEEP_VERB = 307
HTTP_STATUS_BAD_REQUEST = 400
HTTP_STATUS_DENIED = 401
HTTP_STATUS_PAYMENT_REQ = 402
HTTP_STATUS_FORBIDDEN = 403
HTTP_STATUS_NOT_FOUND = 404
HTTP_STATUS_BAD_METHOD = 405
HTTP_STATUS_NONE_ACCEPTABLE = 406
HTTP_STATUS_PROXY_AUTH_REQ = 407
HTTP_STATUS_REQUEST_TIMEOUT = 408
HTTP_STATUS_CONFLICT = 409
HTTP_STATUS_GONE = 410
HTTP_STATUS_LENGTH_REQUIRED = 411
HTTP_STATUS_PRECOND_FAILED = 412
HTTP_STATUS_REQUEST_TOO_LARGE = 413
HTTP_STATUS_URI_TOO_LONG = 414
HTTP_STATUS_UNSUPPORTED_MEDIA = 415
HTTP_STATUS_RETRY_WITH = 449
HTTP_STATUS_SERVER_ERROR = 500
HTTP_STATUS_NOT_SUPPORTED = 501
HTTP_STATUS_BAD_GATEWAY = 502
HTTP_STATUS_SERVICE_UNAVAIL = 503
HTTP_STATUS_GATEWAY_TIMEOUT = 504
HTTP_STATUS_VERSION_NOT_SUP = 505
HTTP_STATUS_FIRST = HTTP_STATUS_CONTINUE
HTTP_STATUS_LAST = HTTP_STATUS_VERSION_NOT_SUP

WINHTTP_ADDREQ_INDEX_MASK = $FFFF
WINHTTP_ADDREQ_FLAGS_MASK = $FFFF0000
WINHTTP_ADDREQ_FLAG_ADD_IF_NEW = $10000000
WINHTTP_ADDREQ_FLAG_ADD = $20000000
WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA = $40000000
WINHTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON = $1000000
WINHTTP_ADDREQ_FLAG_COALESCE = WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA
WINHTTP_ADDREQ_FLAG_REPLACE = $80000000
WINHTTP_NO_ADDITIONAL_HEADERS = NULL
WINHTTP_NO_REQUEST_DATA = NULL
WINHTTP_HEADER_NAME_BY_INDEX = NULL
WINHTTP_NO_OUTPUT_BUFFER = NULL
WINHTTP_NO_HEADER_INDEX = NULL

struct WINHTTPCURRENTUSERIEPROXYCONFIG
       fAutoDetect dd ?,?
       lpszAutoConfigUrl dq ?
       lpszProxy dq ?
       lpszProxyBypass dq ?
ends

WINHTTP_ERROR_BASE = 12000
ERROR_WINHTTP_OUT_OF_HANDLES = (WINHTTP_ERROR_BASE + 1)
ERROR_WINHTTP_TIMEOUT = (WINHTTP_ERROR_BASE + 2)
ERROR_WINHTTP_INTERNAL_ERROR = (WINHTTP_ERROR_BASE + 4)
ERROR_WINHTTP_INVALID_URL = (WINHTTP_ERROR_BASE + 5)
ERROR_WINHTTP_UNRECOGNIZED_SCHEME = (WINHTTP_ERROR_BASE + 6)
ERROR_WINHTTP_NAME_NOT_RESOLVED = (WINHTTP_ERROR_BASE + 7)
ERROR_WINHTTP_INVALID_OPTION = (WINHTTP_ERROR_BASE + 9)
ERROR_WINHTTP_OPTION_NOT_SETTABLE = (WINHTTP_ERROR_BASE + 11)
ERROR_WINHTTP_SHUTDOWN = (WINHTTP_ERROR_BASE + 12)
ERROR_WINHTTP_LOGIN_FAILURE = (WINHTTP_ERROR_BASE + 15)
ERROR_WINHTTP_OPERATION_CANCELLED = (WINHTTP_ERROR_BASE + 17)
ERROR_WINHTTP_INCORRECT_HANDLE_TYPE = (WINHTTP_ERROR_BASE + 18)
ERROR_WINHTTP_INCORRECT_HANDLE_STATE = (WINHTTP_ERROR_BASE + 19)
ERROR_WINHTTP_CANNOT_CONNECT = (WINHTTP_ERROR_BASE + 29)
ERROR_WINHTTP_CONNECTION_ERROR = (WINHTTP_ERROR_BASE + 30)
ERROR_WINHTTP_RESEND_REQUEST = (WINHTTP_ERROR_BASE + 32)
ERROR_WINHTTP_CLIENT_AUTH_CERT_NEEDED = (WINHTTP_ERROR_BASE + 44)
ERROR_WINHTTP_CANNOT_CALL_BEFORE_OPEN = (WINHTTP_ERROR_BASE + 100)
ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND = (WINHTTP_ERROR_BASE + 101)
ERROR_WINHTTP_CANNOT_CALL_AFTER_SEND = (WINHTTP_ERROR_BASE + 102)
ERROR_WINHTTP_CANNOT_CALL_AFTER_OPEN = (WINHTTP_ERROR_BASE + 103)
ERROR_WINHTTP_HEADER_NOT_FOUND = (WINHTTP_ERROR_BASE + 150)
ERROR_WINHTTP_INVALID_SERVER_RESPONSE = (WINHTTP_ERROR_BASE + 152)
ERROR_WINHTTP_INVALID_QUERY_REQUEST = (WINHTTP_ERROR_BASE + 154)
ERROR_WINHTTP_HEADER_ALREADY_EXISTS = (WINHTTP_ERROR_BASE + 155)
ERROR_WINHTTP_REDIRECT_FAILED = (WINHTTP_ERROR_BASE + 156)
ERROR_WINHTTP_AUTO_PROXY_SERVICE_ERROR = (WINHTTP_ERROR_BASE + 178)
ERROR_WINHTTP_BAD_AUTO_PROXY_SCRIPT = (WINHTTP_ERROR_BASE + 166)
ERROR_WINHTTP_UNABLE_TO_DOWNLOAD_SCRIPT = (WINHTTP_ERROR_BASE + 167)
ERROR_WINHTTP_NOT_INITIALIZED = (WINHTTP_ERROR_BASE + 172)
ERROR_WINHTTP_SECURE_FAILURE = (WINHTTP_ERROR_BASE + 175)
ERROR_WINHTTP_SECURE_CERT_DATE_INVALID = (WINHTTP_ERROR_BASE + 37)
ERROR_WINHTTP_SECURE_CERT_CN_INVALID = (WINHTTP_ERROR_BASE + 38)
ERROR_WINHTTP_SECURE_INVALID_CA = (WINHTTP_ERROR_BASE + 45)
ERROR_WINHTTP_SECURE_CERT_REV_FAILED = (WINHTTP_ERROR_BASE + 57)
ERROR_WINHTTP_SECURE_CHANNEL_ERROR = (WINHTTP_ERROR_BASE + 157)
ERROR_WINHTTP_SECURE_INVALID_CERT = (WINHTTP_ERROR_BASE + 169)
ERROR_WINHTTP_SECURE_CERT_REVOKED = (WINHTTP_ERROR_BASE + 170)
ERROR_WINHTTP_SECURE_CERT_WRONG_USAGE = (WINHTTP_ERROR_BASE + 179)
ERROR_WINHTTP_AUTODETECTION_FAILED = (WINHTTP_ERROR_BASE + 180)
ERROR_WINHTTP_HEADER_COUNT_EXCEEDED = (WINHTTP_ERROR_BASE + 181)
ERROR_WINHTTP_HEADER_SIZE_OVERFLOW = (WINHTTP_ERROR_BASE + 182)
ERROR_WINHTTP_CHUNKED_ENCODING_HEADER_SIZE_OVERFLOW = (WINHTTP_ERROR_BASE + 183)
ERROR_WINHTTP_RESPONSE_DRAIN_OVERFLOW = (WINHTTP_ERROR_BASE + 184)
WINHTTP_ERROR_LAST = (WINHTTP_ERROR_BASE + 184)


;Copyright (c) 1995-1999  Microsoft Corporation
;Module Name: wininet.h
;Contains manifests, macros, types and prototypes for Microsoft Windows Internet Extensions

INTERNET_INVALID_PORT_NUMBER = 0
INTERNET_DEFAULT_FTP_PORT = 21
INTERNET_DEFAULT_GOPHER_PORT = 70
INTERNET_DEFAULT_HTTP_PORT = 80
INTERNET_DEFAULT_HTTPS_PORT = 443
INTERNET_DEFAULT_SOCKS_PORT = 1080
INTERNET_MAX_HOST_NAME_LENGTH = 256
INTERNET_MAX_USER_NAME_LENGTH = 128
INTERNET_MAX_PASSWORD_LENGTH = 128
INTERNET_MAX_PORT_NUMBER_LENGTH = 5
INTERNET_MAX_PORT_NUMBER_VALUE	= 65535
INTERNET_MAX_PATH_LENGTH = 2048
INTERNET_MAX_SCHEME_LENGTH = 32
INTERNET_MAX_URL_LENGTH = (INTERNET_MAX_SCHEME_LENGTH + 3 + INTERNET_MAX_PATH_LENGTH)

INTERNET_KEEP_ALIVE_UNKNOWN = -1
INTERNET_KEEP_ALIVE_ENABLED = 1
INTERNET_KEEP_ALIVE_DISABLED = 0

INTERNET_REQFLAG_FROM_CACHE = 1
INTERNET_REQFLAG_ASYNC = 2
INTERNET_REQFLAG_VIA_PROXY = 4
INTERNET_REQFLAG_NO_HEADERS = 8
INTERNET_REQFLAG_PASSIVE = $10
INTERNET_REQFLAG_CACHE_WRITE_DISABLED = $40
INTERNET_REQFLAG_NET_TIMEOUT = $80

INTERNET_FLAG_RELOAD = $80000000
INTERNET_FLAG_RAW_DATA = $40000000
INTERNET_FLAG_EXISTING_CONNECT = $20000000
INTERNET_FLAG_ASYNC = $10000000
INTERNET_FLAG_PASSIVE = $8000000
INTERNET_FLAG_NO_CACHE_WRITE = $4000000
INTERNET_FLAG_DONT_CACHE = INTERNET_FLAG_NO_CACHE_WRITE
INTERNET_FLAG_MAKE_PERSISTENT = $2000000
INTERNET_FLAG_FROM_CACHE = $1000000
INTERNET_FLAG_OFFLINE = INTERNET_FLAG_FROM_CACHE
INTERNET_FLAG_SECURE = $800000
INTERNET_FLAG_KEEP_CONNECTION = $400000
INTERNET_FLAG_NO_AUTO_REDIRECT = $200000
INTERNET_FLAG_READ_PREFETCH = $100000
INTERNET_FLAG_NO_COOKIES = $80000
INTERNET_FLAG_NO_AUTH = $40000
INTERNET_FLAG_RESTRICTED_ZONE = $20000
INTERNET_FLAG_CACHE_IF_NET_FAIL = $10000
INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP = $8000
INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS = $4000
INTERNET_FLAG_IGNORE_CERT_DATE_INVALID = $2000
INTERNET_FLAG_IGNORE_CERT_CN_INVALID = $1000
INTERNET_FLAG_RESYNCHRONIZE = $800
INTERNET_FLAG_HYPERLINK = $400
INTERNET_FLAG_NO_UI = $200
INTERNET_FLAG_PRAGMA_NOCACHE = $100
INTERNET_FLAG_CACHE_ASYNC = $80
INTERNET_FLAG_FORMS_SUBMIT = $40
INTERNET_FLAG_FWD_BACK = $20
INTERNET_FLAG_NEED_FILE = $10
INTERNET_FLAG_MUST_CACHE_REQUEST = INTERNET_FLAG_NEED_FILE
INTERNET_FLAG_TRANSFER_ASCII = FTP_TRANSFER_TYPE_ASCII
INTERNET_FLAG_TRANSFER_BINARY = FTP_TRANSFER_TYPE_BINARY

SECURITY_INTERNET_MASK = (INTERNET_FLAG_IGNORE_CERT_CN_INVALID or \
			  INTERNET_FLAG_IGNORE_CERT_DATE_INVALID or \
			  INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS or \
			  INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP)

INTERNET_FLAGS_MASK = (INTERNET_FLAG_RELOAD or \
		       INTERNET_FLAG_RAW_DATA or \
		       INTERNET_FLAG_EXISTING_CONNECT or \
		       INTERNET_FLAG_ASYNC or \
		       INTERNET_FLAG_PASSIVE or \
		       INTERNET_FLAG_NO_CACHE_WRITE or \
		       INTERNET_FLAG_MAKE_PERSISTENT or \
		       INTERNET_FLAG_FROM_CACHE or \
		       INTERNET_FLAG_SECURE or \
		       INTERNET_FLAG_KEEP_CONNECTION or \
		       INTERNET_FLAG_NO_AUTO_REDIRECT or \
		       INTERNET_FLAG_READ_PREFETCH or \
		       INTERNET_FLAG_NO_COOKIES or \
		       INTERNET_FLAG_NO_AUTH or \
		       INTERNET_FLAG_CACHE_IF_NET_FAIL or \
		       SECURITY_INTERNET_MASK or \
		       INTERNET_FLAG_RESYNCHRONIZE or \
		       INTERNET_FLAG_HYPERLINK or \
		       INTERNET_FLAG_NO_UI or \
		       INTERNET_FLAG_PRAGMA_NOCACHE or \
		       INTERNET_FLAG_CACHE_ASYNC or \
		       INTERNET_FLAG_FORMS_SUBMIT or \
		       INTERNET_FLAG_NEED_FILE or \
		       INTERNET_FLAG_RESTRICTED_ZONE or \
		       INTERNET_FLAG_TRANSFER_BINARY or \
		       INTERNET_FLAG_TRANSFER_ASCII or \
		       INTERNET_FLAG_FWD_BACK)

INTERNET_ERROR_MASK_INSERT_CDROM = 1
INTERNET_ERROR_MASK_COMBINED_SEC_CERT = 2
INTERNET_ERROR_MASK_NEED_MSN_SSPI_PKG = 4
INTERNET_ERROR_MASK_LOGIN_FAILURE_DISPLAY_ENTITY_BODY = 8

INTERNET_OPTIONS_MASK = not INTERNET_FLAGS_MASK

WININET_API_FLAG_ASYNC = 1
WININET_API_FLAG_SYNC = 4
WININET_API_FLAG_USE_CONTEXT = 8

INTERNET_NO_CALLBACK = 0
INTERNET_SCHEME_PARTIAL = -2
INTERNET_SCHEME_UNKNOWN = -1
INTERNET_SCHEME_DEFAULT = 0
INTERNET_SCHEME_FTP = 1
INTERNET_SCHEME_GOPHER = 2
INTERNET_SCHEME_HTTP = 3
INTERNET_SCHEME_HTTPS = 4
INTERNET_SCHEME_FILE = 5
INTERNET_SCHEME_NEWS = 6
INTERNET_SCHEME_MAILTO = 7
INTERNET_SCHEME_SOCKS = 8
INTERNET_SCHEME_JAVASCRIPT = 9
INTERNET_SCHEME_VBSCRIPT = 10
INTERNET_SCHEME_RES = 11
INTERNET_SCHEME_FIRST = INTERNET_SCHEME_FTP
INTERNET_SCHEME_LAST = INTERNET_SCHEME_RES

struct INTERNETASYNCRESULT
       dwResult dq ?
       dwError dd ?,?
ends

struct INTERNETDIAGNOSTICSOCKETINFO
       Socket dq ?
       SourcePort dd ?
       DestPort dd ?
       Flags dd ?,?
ends

IDSI_FLAG_KEEP_ALIVE = 1
IDSI_FLAG_SECURE = 2
IDSI_FLAG_PROXY = 4
IDSI_FLAG_TUNNEL = 8

struct INTERNETPROXYINFO
       dwAccessType dd ?,?
       lpszProxy dq ?
       lpszProxyBypass dq ?
ends

struct INTERNETPERCONNOPTIONA
       dwOption dd ?
       union
	  dwValue dd ?
	  pszValue dq ?
	  ftValue FILETIME
       ends
       dd ?
ends

struct INTERNETPERCONNOPTIONW
       dwOption dd ?
       union
	  dwValue dd ?
	  pszValue dq ?
	  ftValue FILETIME
       ends
       dd ?
ends

struct INTERNETPERCONNOPTIONLISTA
       dwSize dd ?,?
       pszConnection dq ?
       dwOptionCount dd ?
       dwOptionError dd ?
       pOptions dq ?
ends

struct INTERNETPERCONNOPTIONLISTW
       dwSize dd ?,?
       pszConnection dq ?
       dwOptionCount dd ?
       dwOptionError dd ?
       pOptions dq ?
ends

INTERNET_PER_CONN_FLAGS = 1
INTERNET_PER_CONN_PROXY_SERVER = 2
INTERNET_PER_CONN_PROXY_BYPASS = 3
INTERNET_PER_CONN_AUTOCONFIG_URL = 4
INTERNET_PER_CONN_AUTODISCOVERY_FLAGS = 5
INTERNET_PER_CONN_AUTOCONFIG_SECONDARY_URL = 6
INTERNET_PER_CONN_AUTOCONFIG_RELOAD_DELAY_MINS = 7
INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_TIME = 8
INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_URL = 9

PROXY_TYPE_DIRECT = 1
PROXY_TYPE_PROXY = 2
PROXY_TYPE_AUTO_PROXY_URL = 4
PROXY_TYPE_AUTO_DETECT = 8

AUTO_PROXY_FLAG_USER_SET = 1
AUTO_PROXY_FLAG_ALWAYS_DETECT = 2
AUTO_PROXY_FLAG_DETECTION_RUN = 4
AUTO_PROXY_FLAG_MIGRATED = 8
AUTO_PROXY_FLAG_DONT_CACHE_PROXY_RESULT = $10
AUTO_PROXY_FLAG_CACHE_INIT_RUN = $20
AUTO_PROXY_FLAG_DETECTION_SUSPECT = $40

struct INTERNETVERSIONINFO
       dwMajorVersion dd ?
       dwMinorVersion dd ?
ends

struct INTERNETCONNECTEDINFO
       dwConnectedState dd ?
       dwFlags dd ?
ends

ISO_FORCE_DISCONNECTED = 1

struct URLCOMPONENTSA
       dwStructSize dd ?,?
       lpszScheme dq ?
       dwSchemeLength dd ?
       nScheme dd ?
       lpszHostName dq ?
       dwHostNameLength dd ?
       nPort dw ?,?
       lpszUserName dq ?
       dwUserNameLength dd ?,?
       lpszPassword dq ?
       dwPasswordLength dd ?,?
       lpszUrlPath dq ?
       dwUrlPathLength dd ?,?
       lpszExtraInfo dq ?
       dwExtraInfoLength dd ?,?
ends

struct URLCOMPONENTSW
       dwStructSize dd ?,?
       lpszScheme dq ?
       dwSchemeLength dd ?
       nScheme dd ?
       lpszHostName dq ?
       dwHostNameLength dd ?
       nPort dw ?,?
       lpszUserName dq ?
       dwUserNameLength dd ?,?
       lpszPassword dq ?
       dwPasswordLength dd ?,?
       lpszUrlPath dq ?
       dwUrlPathLength dd ?,?
       lpszExtraInfo dq ?
       dwExtraInfoLength dd ?,?
ends

struct INTERNETCERTIFICATEINFO
       ftExpiry FILETIME
       ftStart FILETIME
       lpszSubjectInfo dq ?
       lpszIssuerInfo dq ?
       lpszProtocolName dq ?
       lpszSignatureAlgName dq ?
       lpszEncryptionAlgName dq ?
       dwKeySize dd ?,?
ends

struct INTERNETBUFFERSA
       dwStructSize dd ?,?
       Next dq ?
       lpcszHeader dq ?
       dwHeadersLength dd ?
       dwHeadersTotal dd ?
       lpvBuffer dq ?
       dwBufferLength dd ?
       dwBufferTotal dd ?
       dwOffsetLow dd ?
       dwOffsetHigh dd ?
ends

struct INTERNETBUFFERSW
       dwStructSize dd ?,?
       Next dq ?
       lpcszHeader dq ?
       dwHeadersLength dd ?
       dwHeadersTotal dd ?
       lpvBuffer dq ?
       dwBufferLength dd ?
       dwBufferTotal dd ?
       dwOffsetLow dd ?
       dwOffsetHigh dd ?
ends

INTERNET_RFC1123_FORMAT = 0
INTERNET_RFC1123_BUFSIZE = 30

ICU_ESCAPE = $80000000
ICU_USERNAME = $40000000
ICU_NO_ENCODE = $20000000
ICU_DECODE = $10000000
ICU_NO_META = $8000000
ICU_ENCODE_SPACES_ONLY = $4000000
ICU_BROWSER_MODE = $2000000
ICU_ENCODE_PERCENT = $1000

INTERNET_OPEN_TYPE_PRECONFIG = 0
INTERNET_OPEN_TYPE_DIRECT = 1
INTERNET_OPEN_TYPE_PROXY = 3
INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY	= 4

PRE_CONFIG_INTERNET_ACCESS = INTERNET_OPEN_TYPE_PRECONFIG
LOCAL_INTERNET_ACCESS = INTERNET_OPEN_TYPE_DIRECT
CERN_PROXY_INTERNET_ACCESS = INTERNET_OPEN_TYPE_PROXY

INTERNET_SERVICE_FTP = 1
INTERNET_SERVICE_GOPHER = 2
INTERNET_SERVICE_HTTP = 3

IRF_ASYNC = WININET_API_FLAG_ASYNC
IRF_SYNC = WININET_API_FLAG_SYNC
IRF_USE_CONTEXT = WININET_API_FLAG_USE_CONTEXT
IRF_NO_WAIT = 8

ISO_GLOBAL = 1
ISO_REGISTRY = 2
ISO_VALID_FLAGS = (ISO_GLOBAL or ISO_REGISTRY)

INTERNET_OPTION_CALLBACK = 1
INTERNET_OPTION_CONNECT_TIMEOUT = 2
INTERNET_OPTION_CONNECT_RETRIES = 3
INTERNET_OPTION_CONNECT_BACKOFF = 4
INTERNET_OPTION_SEND_TIMEOUT = 5
INTERNET_OPTION_CONTROL_SEND_TIMEOUT = INTERNET_OPTION_SEND_TIMEOUT
INTERNET_OPTION_RECEIVE_TIMEOUT = 6
INTERNET_OPTION_CONTROL_RECEIVE_TIMEOUT = INTERNET_OPTION_RECEIVE_TIMEOUT
INTERNET_OPTION_DATA_SEND_TIMEOUT = 7
INTERNET_OPTION_DATA_RECEIVE_TIMEOUT = 8
INTERNET_OPTION_HANDLE_TYPE = 9
INTERNET_OPTION_LISTEN_TIMEOUT = 11
INTERNET_OPTION_READ_BUFFER_SIZE = 12
INTERNET_OPTION_WRITE_BUFFER_SIZE = 13
INTERNET_OPTION_ASYNC_ID = 15
INTERNET_OPTION_ASYNC_PRIORITY = 16
INTERNET_OPTION_PARENT_HANDLE = 21
INTERNET_OPTION_KEEP_CONNECTION = 22
INTERNET_OPTION_REQUEST_FLAGS = 23
INTERNET_OPTION_EXTENDED_ERROR = 24
INTERNET_OPTION_OFFLINE_MODE = 26
INTERNET_OPTION_CACHE_STREAM_HANDLE  = 27
INTERNET_OPTION_USERNAME = 28
INTERNET_OPTION_PASSWORD = 29
INTERNET_OPTION_ASYNC = 30
INTERNET_OPTION_SECURITY_FLAGS = 31
INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT = 32
INTERNET_OPTION_DATAFILE_NAME = 33
INTERNET_OPTION_URL = 34
INTERNET_OPTION_SECURITY_CERTIFICATE = 35
INTERNET_OPTION_SECURITY_KEY_BITNESS = 36
INTERNET_OPTION_REFRESH = 37
INTERNET_OPTION_PROXY = 38
INTERNET_OPTION_SETTINGS_CHANGED = 39
INTERNET_OPTION_VERSION = 40
INTERNET_OPTION_USER_AGENT = 41
INTERNET_OPTION_END_BROWSER_SESSION = 42
INTERNET_OPTION_PROXY_USERNAME = 43
INTERNET_OPTION_PROXY_PASSWORD = 44
INTERNET_OPTION_CONTEXT_VALUE = 45
INTERNET_OPTION_CONNECT_LIMIT = 46
INTERNET_OPTION_SECURITY_SELECT_CLIENT_CERT = 47
INTERNET_OPTION_POLICY = 48
INTERNET_OPTION_DISCONNECTED_TIMEOUT = 49
INTERNET_OPTION_CONNECTED_STATE = 50
INTERNET_OPTION_IDLE_STATE = 51
INTERNET_OPTION_OFFLINE_SEMANTICS = 52
INTERNET_OPTION_SECONDARY_CACHE_KEY = 53
INTERNET_OPTION_CALLBACK_FILTER = 54
INTERNET_OPTION_CONNECT_TIME = 55
INTERNET_OPTION_SEND_THROUGHPUT = 56
INTERNET_OPTION_RECEIVE_THROUGHPUT = 57
INTERNET_OPTION_REQUEST_PRIORITY = 58
INTERNET_OPTION_HTTP_VERSION = 59
INTERNET_OPTION_RESET_URLCACHE_SESSION = 60
INTERNET_OPTION_ERROR_MASK = 62
INTERNET_OPTION_FROM_CACHE_TIMEOUT = 63
INTERNET_OPTION_BYPASS_EDITED_ENTRY = 64
INTERNET_OPTION_DIAGNOSTIC_SOCKET_INFO = 67
INTERNET_OPTION_CODEPAGE = 68
INTERNET_OPTION_CACHE_TIMESTAMPS = 69
INTERNET_OPTION_DISABLE_AUTODIAL = 70
INTERNET_OPTION_MAX_CONNS_PER_SERVER = 73
INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER = 74
INTERNET_OPTION_PER_CONNECTION_OPTION = 75
INTERNET_OPTION_DIGEST_AUTH_UNLOAD = 76
INTERNET_OPTION_IGNORE_OFFLINE = 77
INTERNET_OPTION_IDENTITY = 78
INTERNET_OPTION_REMOVE_IDENTITY = 79
INTERNET_OPTION_ALTER_IDENTITY = 80
INTERNET_OPTION_SUPPRESS_BEHAVIOR = 81
INTERNET_OPTION_AUTODIAL_MODE = 82
INTERNET_OPTION_AUTODIAL_CONNECTION = 83
INTERNET_OPTION_CLIENT_CERT_CONTEXT = 84
INTERNET_OPTION_AUTH_FLAGS = 85
INTERNET_OPTION_COOKIES_3RD_PARTY = 86
INTERNET_OPTION_DISABLE_PASSPORT_AUTH = 87
INTERNET_OPTION_SEND_UTF8_SERVERNAME_TO_PROXY = 88
INTERNET_OPTION_EXEMPT_CONNECTION_LIMIT = 89
INTERNET_OPTION_ENABLE_PASSPORT_AUTH = 90
INTERNET_OPTION_HIBERNATE_INACTIVE_WORKER_THREADS = 91
INTERNET_OPTION_ACTIVATE_WORKER_THREADS = 92
INTERNET_OPTION_RESTORE_WORKER_THREAD_DEFAULTS = 93
INTERNET_OPTION_SOCKET_SEND_BUFFER_LENGTH = 94
INTERNET_OPTION_PROXY_SETTINGS_CHANGED = 95
INTERNET_OPTION_DATAFILE_EXT = 96

INTERNET_FIRST_OPTION = INTERNET_OPTION_CALLBACK
INTERNET_LAST_OPTION = INTERNET_OPTION_DATAFILE_EXT

INTERNET_PRIORITY_FOREGROUND = 1000

INTERNET_HANDLE_TYPE_INTERNET = 1
INTERNET_HANDLE_TYPE_CONNECT_FTP = 2
INTERNET_HANDLE_TYPE_CONNECT_GOPHER = 3
INTERNET_HANDLE_TYPE_CONNECT_HTTP = 4
INTERNET_HANDLE_TYPE_FTP_FIND = 5
INTERNET_HANDLE_TYPE_FTP_FIND_HTML = 6
INTERNET_HANDLE_TYPE_FTP_FILE = 7
INTERNET_HANDLE_TYPE_FTP_FILE_HTML = 8
INTERNET_HANDLE_TYPE_GOPHER_FIND = 9
INTERNET_HANDLE_TYPE_GOPHER_FIND_HTML = 10
INTERNET_HANDLE_TYPE_GOPHER_FILE = 11
INTERNET_HANDLE_TYPE_GOPHER_FILE_HTML = 12
INTERNET_HANDLE_TYPE_HTTP_REQUEST = 13
INTERNET_HANDLE_TYPE_FILE_REQUEST = 14

AUTH_FLAG_DISABLE_NEGOTIATE = 1
AUTH_FLAG_ENABLE_NEGOTIATE = 2
AUTH_FLAG_DISABLE_BASIC_CLEARCHANNEL = 4

SECURITY_FLAG_SECURE = 1
SECURITY_FLAG_STRENGTH_WEAK = $10000000
SECURITY_FLAG_STRENGTH_MEDIUM = $40000000
SECURITY_FLAG_STRENGTH_STRONG = $20000000
SECURITY_FLAG_UNKNOWNBIT = $80000000
SECURITY_FLAG_FORTEZZA = $8000000
SECURITY_FLAG_NORMALBITNESS = SECURITY_FLAG_STRENGTH_WEAK
SECURITY_FLAG_SSL = 2
SECURITY_FLAG_SSL3 = 4
SECURITY_FLAG_PCT = 8
SECURITY_FLAG_PCT4 = $10
SECURITY_FLAG_IETFSSL4 = $20
SECURITY_FLAG_40BIT = SECURITY_FLAG_STRENGTH_WEAK
SECURITY_FLAG_128BIT = SECURITY_FLAG_STRENGTH_STRONG
SECURITY_FLAG_56BIT = SECURITY_FLAG_STRENGTH_MEDIUM
SECURITY_FLAG_IGNORE_REVOCATION = $80
SECURITY_FLAG_IGNORE_UNKNOWN_CA = $100
SECURITY_FLAG_IGNORE_WRONG_USAGE = $200
SECURITY_FLAG_IGNORE_CERT_CN_INVALID = INTERNET_FLAG_IGNORE_CERT_CN_INVALID
SECURITY_FLAG_IGNORE_CERT_DATE_INVALID = INTERNET_FLAG_IGNORE_CERT_DATE_INVALID
SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTPS = INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS
SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTP = INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP

SECURITY_SET_MASK = (SECURITY_FLAG_IGNORE_REVOCATION or\
		     SECURITY_FLAG_IGNORE_UNKNOWN_CA or\
		     SECURITY_FLAG_IGNORE_CERT_CN_INVALID or\
		     SECURITY_FLAG_IGNORE_CERT_DATE_INVALID or\
		     SECURITY_FLAG_IGNORE_WRONG_USAGE)

AUTODIAL_MODE_NEVER = 1
AUTODIAL_MODE_ALWAYS = 2
AUTODIAL_MODE_NO_NETWORK_PRESENT = 4

INTERNET_STATUS_RESOLVING_NAME = 10
INTERNET_STATUS_NAME_RESOLVED = 11
INTERNET_STATUS_CONNECTING_TO_SERVER = 20
INTERNET_STATUS_CONNECTED_TO_SERVER = 21
INTERNET_STATUS_SENDING_REQUEST = 30
INTERNET_STATUS_REQUEST_SENT = 31
INTERNET_STATUS_RECEIVING_RESPONSE = 40
INTERNET_STATUS_RESPONSE_RECEIVED = 41
INTERNET_STATUS_CTL_RESPONSE_RECEIVED = 42
INTERNET_STATUS_PREFETCH = 43
INTERNET_STATUS_CLOSING_CONNECTION = 50
INTERNET_STATUS_CONNECTION_CLOSED = 51
INTERNET_STATUS_HANDLE_CREATED = 60
INTERNET_STATUS_HANDLE_CLOSING = 70
INTERNET_STATUS_DETECTING_PROXY = 80
INTERNET_STATUS_REQUEST_COMPLETE = 100
INTERNET_STATUS_REDIRECT = 110
INTERNET_STATUS_INTERMEDIATE_RESPONSE = 120
INTERNET_STATUS_USER_INPUT_REQUIRED = 140
INTERNET_STATUS_STATE_CHANGE = 200
INTERNET_STATUS_COOKIE_SENT = 320
INTERNET_STATUS_COOKIE_RECEIVED = 321
INTERNET_STATUS_PRIVACY_IMPACTED = 324
INTERNET_STATUS_P3P_HEADER = 325
INTERNET_STATUS_P3P_POLICYREF = 326
INTERNET_STATUS_COOKIE_HISTORY = 327

INTERNET_STATE_CONNECTED = 1
INTERNET_STATE_DISCONNECTED = 2
INTERNET_STATE_DISCONNECTED_BY_USER = 10
INTERNET_STATE_IDLE = 100
INTERNET_STATE_BUSY = 200

COOKIE_STATE_UNKNOWN = 0
COOKIE_STATE_ACCEPT = 1
COOKIE_STATE_PROMPT = 2
COOKIE_STATE_LEASH = 3
COOKIE_STATE_DOWNGRADE = 4
COOKIE_STATE_REJECT = 5
COOKIE_STATE_MAX = COOKIE_STATE_REJECT

struct INCOMINGCOOKIESTATE
       cSession dd ?
       cPersistent dd ?
       cAccepted dd ?
       cLeashed dd ?
       cDowngraded dd ?
       cBlocked dd ?
       pszLocation dq ?
ends

struct OUTGOINGCOOKIESTATE
       cSent dd ?
       cSuppressed dd ?
       pszLocation dq ?
ends

struct INTERNETCOOKIEHISTORY
       fAccepted dd ?
       fLeashed dd ?
       fDowngraded dd ?
       fRejected dd ?
ends

struct COOKIEDECISION
       dwCookieState dd ?
       fAllowSession dd ?
ends

INTERNET_INVALID_STATUS_CALLBACK = -1

FTP_TRANSFER_TYPE_UNKNOWN = 0
FTP_TRANSFER_TYPE_ASCII = 1
FTP_TRANSFER_TYPE_BINARY = 2
FTP_TRANSFER_TYPE_MASK = (FTP_TRANSFER_TYPE_ASCII or FTP_TRANSFER_TYPE_BINARY)

MAX_GOPHER_DISPLAY_TEXT = 128
MAX_GOPHER_SELECTOR_TEXT = 256
MAX_GOPHER_HOST_NAME = INTERNET_MAX_HOST_NAME_LENGTH
MAX_GOPHER_LOCATOR_LENGTH = (1 + MAX_GOPHER_DISPLAY_TEXT + 1 + MAX_GOPHER_SELECTOR_TEXT\
			    + 1 + MAX_GOPHER_HOST_NAME + 1 + INTERNET_MAX_PORT_NUMBER_LENGTH\
			    + 1 + 1 + 2)

struct GOPHERFINDDATAA
       DisplayString db MAX_GOPHER_DISPLAY_TEXT + 1 dup(?)
       GopherType dd ?
       SizeLow dd ?
       SizeHigh dd ?
       LastModificationTime FILETIME
       Locator db MAX_GOPHER_LOCATOR_LENGTH + 6 dup(?)
ends

struct GOPHERFINDDATAW
       DisplayString du MAX_GOPHER_DISPLAY_TEXT + 1 dup(?)
       GopherType dd ?
       SizeLow dd ?
       SizeHigh dd ?
       LastModificationTime FILETIME
       Locator du MAX_GOPHER_LOCATOR_LENGTH + 2 dup(?)
ends

GOPHER_TYPE_TEXT_FILE = 1
GOPHER_TYPE_DIRECTORY = 2
GOPHER_TYPE_CSO = 4
GOPHER_TYPE_ERROR = 8
GOPHER_TYPE_MAC_BINHEX = $10
GOPHER_TYPE_DOS_ARCHIVE = $20
GOPHER_TYPE_UNIX_UUENCODED = $40
GOPHER_TYPE_INDEX_SERVER = $80
GOPHER_TYPE_TELNET = $100
GOPHER_TYPE_BINARY = $200
GOPHER_TYPE_REDUNDANT = $400
GOPHER_TYPE_TN3270 = $800
GOPHER_TYPE_GIF = $1000
GOPHER_TYPE_IMAGE = $2000
GOPHER_TYPE_BITMAP = $4000
GOPHER_TYPE_MOVIE = $8000
GOPHER_TYPE_SOUND = $10000
GOPHER_TYPE_HTML = $20000
GOPHER_TYPE_PDF = $40000
GOPHER_TYPE_CALENDAR = $80000
GOPHER_TYPE_INLINE = $100000
GOPHER_TYPE_UNKNOWN = $20000000
GOPHER_TYPE_ASK = $40000000
GOPHER_TYPE_GOPHER_PLUS = $80000000

;IS_GOPHER_FILE(type)            (BOOL)(((type) & GOPHER_TYPE_FILE_MASK) ? TRUE : FALSE)
;IS_GOPHER_DIRECTORY(type)       (BOOL)(((type) & GOPHER_TYPE_DIRECTORY) ? TRUE : FALSE)
;IS_GOPHER_PHONE_SERVER(type)    (BOOL)(((type) & GOPHER_TYPE_CSO) ? TRUE : FALSE)
;IS_GOPHER_ERROR(type)           (BOOL)(((type) & GOPHER_TYPE_ERROR) ? TRUE : FALSE)
;IS_GOPHER_INDEX_SERVER(type)    (BOOL)(((type) & GOPHER_TYPE_INDEX_SERVER) ? TRUE : FALSE)
;IS_GOPHER_TELNET_SESSION(type)  (BOOL)(((type) & GOPHER_TYPE_TELNET) ? TRUE : FALSE)
;IS_GOPHER_BACKUP_SERVER(type)   (BOOL)(((type) & GOPHER_TYPE_REDUNDANT) ? TRUE : FALSE)
;IS_GOPHER_TN3270_SESSION(type)  (BOOL)(((type) & GOPHER_TYPE_TN3270) ? TRUE : FALSE)
;IS_GOPHER_ASK(type)             (BOOL)(((type) & GOPHER_TYPE_ASK) ? TRUE : FALSE)
;IS_GOPHER_PLUS(type)            (BOOL)(((type) & GOPHER_TYPE_GOPHER_PLUS) ? TRUE : FALSE)
;IS_GOPHER_TYPE_KNOWN(type)      (BOOL)(((type) & GOPHER_TYPE_UNKNOWN) ? FALSE : TRUE)

GOPHER_TYPE_FILE_MASK = (GOPHER_TYPE_TEXT_FILE or GOPHER_TYPE_MAC_BINHEX or\
			GOPHER_TYPE_DOS_ARCHIVE or GOPHER_TYPE_UNIX_UUENCODED or\
			GOPHER_TYPE_BINARY or GOPHER_TYPE_GIF or GOPHER_TYPE_IMAGE or\
			GOPHER_TYPE_BITMAP or GOPHER_TYPE_MOVIE or GOPHER_TYPE_SOUND or\
			GOPHER_TYPE_HTML or GOPHER_TYPE_PDF or GOPHER_TYPE_CALENDAR or\
			GOPHER_TYPE_INLINE)

struct GOPHERADMINATTRIBUTETYPE
       Comment dq ?
       EmailAddress dq ?
ends

struct GOPHERMODDATEATTRIBUTETYPE
       DateAndTime FILETIME
ends

struct GOPHERTTLATTRIBUTETYPE
       Ttl dd ?
ends

struct GOPHERSCOREATTRIBUTETYPE
       Score dd ?
ends

struct GOPHERSCORERANGEATTRIBUTETYPE
       LowerBound dd ?
       UpperBound dd ?
ends

struct GOPHERSITEATTRIBUTETYPE
       Site dq ?
ends

struct GOPHERORGANIZATIONATTRIBUTETYPE
       Organization dq ?
ends

struct GOPHERLOCATIONATTRIBUTETYPE
       Location dq ?
ends

struct GOPHERGEOGRAPHICALLOCATIONATTRIBUTETYPE
       DegreesNorth dd ?
       MinutesNorth dd ?
       SecondsNorth dd ?
       DegreesEast dd ?
       MinutesEast dd ?
       SecondsEast dd ?
ends

struct GOPHERTIMEZONEATTRIBUTETYPE
       Zone dd ?
ends

struct GOPHERPROVIDERATTRIBUTETYPE
       Provider dq ?
ends

struct GOPHERVERSIONATTRIBUTETYPE
       Version dq ?
ends

struct GOPHERABSTRACTATTRIBUTETYPE
       ShortAbstract dq ?
       AbstractFile dq ?
ends

struct GOPHERVIEWATTRIBUTETYPE
       ContentType dq ?
       Language dq ?
       Size dd ?,?
ends

struct GOPHERVERONICAATTRIBUTETYPE
       TreeWalk dd ?
ends

struct GOPHERASKATTRIBUTETYPE
       QuestionType dq ?
       QuestionText dq ?
ends

struct GOPHERUNKNOWNATTRIBUTETYPE
       Text dq ?
ends

struct GOPHERATTRIBUTETYPE
       CategoryId dd ?
       AttributeId dd ?
       union
	   Admin GOPHERADMINATTRIBUTETYPE
	   ModDate GOPHERMODDATEATTRIBUTETYPE
	   Ttl GOPHERTTLATTRIBUTETYPE
	   Score GOPHERSCOREATTRIBUTETYPE
	   ScoreRange GOPHERSCORERANGEATTRIBUTETYPE
	   Site GOPHERSITEATTRIBUTETYPE
	   Organization GOPHERORGANIZATIONATTRIBUTETYPE
	   Location GOPHERLOCATIONATTRIBUTETYPE
	   GeographicalLocation GOPHERGEOGRAPHICALLOCATIONATTRIBUTETYPE
	   TimeZone GOPHERTIMEZONEATTRIBUTETYPE
	   Provider GOPHERPROVIDERATTRIBUTETYPE
	   Version GOPHERVERSIONATTRIBUTETYPE
	   Abstract GOPHERABSTRACTATTRIBUTETYPE
	   View GOPHERVIEWATTRIBUTETYPE
	   Veronica GOPHERVERONICAATTRIBUTETYPE
	   Ask GOPHERASKATTRIBUTETYPE
	   Unknown GOPHERUNKNOWNATTRIBUTETYPE
       ends
ends

MAX_GOPHER_CATEGORY_NAME = 128
MAX_GOPHER_ATTRIBUTE_NAME = 128
MIN_GOPHER_ATTRIBUTE_LENGTH = 256

GOPHER_INFO_CATEGORY equ "+INFO"
GOPHER_ADMIN_CATEGORY equ "+ADMIN"
GOPHER_VIEWS_CATEGORY equ "+VIEWS"
GOPHER_ABSTRACT_CATEGORY equ "+ABSTRACT"
GOPHER_VERONICA_CATEGORY equ "+VERONICA"
GOPHER_ADMIN_ATTRIBUTE equ "Admin"
GOPHER_MOD_DATE_ATTRIBUTE equ "Mod-Date"
GOPHER_TTL_ATTRIBUTE equ "TTL"
GOPHER_SCORE_ATTRIBUTE equ "Score"
GOPHER_RANGE_ATTRIBUTE equ "Score-range"
GOPHER_SITE_ATTRIBUTE equ "Site"
GOPHER_ORG_ATTRIBUTE equ "Org"
GOPHER_LOCATION_ATTRIBUTE equ "Loc"
GOPHER_GEOG_ATTRIBUTE equ "Geog"
GOPHER_TIMEZONE_ATTRIBUTE equ "TZ"
GOPHER_PROVIDER_ATTRIBUTE equ "Provider"
GOPHER_VERSION_ATTRIBUTE equ "Version"
GOPHER_ABSTRACT_ATTRIBUTE equ "Abstract"
GOPHER_VIEW_ATTRIBUTE equ "View"
GOPHER_TREEWALK_ATTRIBUTE equ "treewalk"

GOPHER_ATTRIBUTE_ID_BASE = $abcccc00
GOPHER_CATEGORY_ID_ALL = (GOPHER_ATTRIBUTE_ID_BASE + 1)
GOPHER_CATEGORY_ID_INFO = (GOPHER_ATTRIBUTE_ID_BASE + 2)
GOPHER_CATEGORY_ID_ADMIN = (GOPHER_ATTRIBUTE_ID_BASE + 3)
GOPHER_CATEGORY_ID_VIEWS = (GOPHER_ATTRIBUTE_ID_BASE + 4)
GOPHER_CATEGORY_ID_ABSTRACT = (GOPHER_ATTRIBUTE_ID_BASE + 5)
GOPHER_CATEGORY_ID_VERONICA = (GOPHER_ATTRIBUTE_ID_BASE + 6)
GOPHER_CATEGORY_ID_ASK = (GOPHER_ATTRIBUTE_ID_BASE + 7)
GOPHER_CATEGORY_ID_UNKNOWN = (GOPHER_ATTRIBUTE_ID_BASE + 8)
GOPHER_ATTRIBUTE_ID_ALL = (GOPHER_ATTRIBUTE_ID_BASE + 9)
GOPHER_ATTRIBUTE_ID_ADMIN = (GOPHER_ATTRIBUTE_ID_BASE + 10)
GOPHER_ATTRIBUTE_ID_MOD_DATE = (GOPHER_ATTRIBUTE_ID_BASE + 11)
GOPHER_ATTRIBUTE_ID_TTL = (GOPHER_ATTRIBUTE_ID_BASE + 12)
GOPHER_ATTRIBUTE_ID_SCORE = (GOPHER_ATTRIBUTE_ID_BASE + 13)
GOPHER_ATTRIBUTE_ID_RANGE = (GOPHER_ATTRIBUTE_ID_BASE + 14)
GOPHER_ATTRIBUTE_ID_SITE = (GOPHER_ATTRIBUTE_ID_BASE + 15)
GOPHER_ATTRIBUTE_ID_ORG = (GOPHER_ATTRIBUTE_ID_BASE + 16)
GOPHER_ATTRIBUTE_ID_LOCATION = (GOPHER_ATTRIBUTE_ID_BASE + 17)
GOPHER_ATTRIBUTE_ID_GEOG = (GOPHER_ATTRIBUTE_ID_BASE + 18)
GOPHER_ATTRIBUTE_ID_TIMEZONE = (GOPHER_ATTRIBUTE_ID_BASE + 19)
GOPHER_ATTRIBUTE_ID_PROVIDER = (GOPHER_ATTRIBUTE_ID_BASE + 20)
GOPHER_ATTRIBUTE_ID_VERSION = (GOPHER_ATTRIBUTE_ID_BASE + 21)
GOPHER_ATTRIBUTE_ID_ABSTRACT = (GOPHER_ATTRIBUTE_ID_BASE + 22)
GOPHER_ATTRIBUTE_ID_VIEW = (GOPHER_ATTRIBUTE_ID_BASE + 23)
GOPHER_ATTRIBUTE_ID_TREEWALK = (GOPHER_ATTRIBUTE_ID_BASE + 24)
GOPHER_ATTRIBUTE_ID_UNKNOWN = (GOPHER_ATTRIBUTE_ID_BASE + 25)

HTTP_MAJOR_VERSION = 1
HTTP_MINOR_VERSION = 0
HTTP_VERSIONA equ "HTTP/1.0"
HTTP_VERSIONW equ "HTTP/1.0"

HTTP_QUERY_MIME_VERSION = 0
HTTP_QUERY_CONTENT_TYPE = 1
HTTP_QUERY_CONTENT_TRANSFER_ENCODING = 2
HTTP_QUERY_CONTENT_ID = 3
HTTP_QUERY_CONTENT_DESCRIPTION = 4
HTTP_QUERY_CONTENT_LENGTH = 5
HTTP_QUERY_CONTENT_LANGUAGE = 6
HTTP_QUERY_ALLOW = 7
HTTP_QUERY_PUBLIC = 8
HTTP_QUERY_DATE = 9
HTTP_QUERY_EXPIRES = 10
HTTP_QUERY_LAST_MODIFIED = 11
HTTP_QUERY_MESSAGE_ID = 12
HTTP_QUERY_URI = 13
HTTP_QUERY_DERIVED_FROM = 14
HTTP_QUERY_COST = 15
HTTP_QUERY_LINK = 16
HTTP_QUERY_PRAGMA = 17
HTTP_QUERY_VERSION = 18
HTTP_QUERY_STATUS_CODE = 19
HTTP_QUERY_STATUS_TEXT = 20
HTTP_QUERY_RAW_HEADERS = 21
HTTP_QUERY_RAW_HEADERS_CRLF = 22
HTTP_QUERY_CONNECTION = 23
HTTP_QUERY_ACCEPT = 24
HTTP_QUERY_ACCEPT_CHARSET = 25
HTTP_QUERY_ACCEPT_ENCODING = 26
HTTP_QUERY_ACCEPT_LANGUAGE = 27
HTTP_QUERY_AUTHORIZATION = 28
HTTP_QUERY_CONTENT_ENCODING = 29
HTTP_QUERY_FORWARDED = 30
HTTP_QUERY_FROM = 31
HTTP_QUERY_IF_MODIFIED_SINCE = 32
HTTP_QUERY_LOCATION = 33
HTTP_QUERY_ORIG_URI = 34
HTTP_QUERY_REFERER = 35
HTTP_QUERY_RETRY_AFTER = 36
HTTP_QUERY_SERVER = 37
HTTP_QUERY_TITLE = 38
HTTP_QUERY_USER_AGENT = 39
HTTP_QUERY_WWW_AUTHENTICATE = 40
HTTP_QUERY_PROXY_AUTHENTICATE = 41
HTTP_QUERY_ACCEPT_RANGES = 42
HTTP_QUERY_SET_COOKIE = 43
HTTP_QUERY_COOKIE = 44
HTTP_QUERY_REQUEST_METHOD = 45
HTTP_QUERY_REFRESH = 46
HTTP_QUERY_CONTENT_DISPOSITION = 47
HTTP_QUERY_AGE = 48
HTTP_QUERY_CACHE_CONTROL = 49
HTTP_QUERY_CONTENT_BASE = 50
HTTP_QUERY_CONTENT_LOCATION = 51
HTTP_QUERY_CONTENT_MD5 = 52
HTTP_QUERY_CONTENT_RANGE = 53
HTTP_QUERY_ETAG = 54
HTTP_QUERY_HOST = 55
HTTP_QUERY_IF_MATCH = 56
HTTP_QUERY_IF_NONE_MATCH = 57
HTTP_QUERY_IF_RANGE = 58
HTTP_QUERY_IF_UNMODIFIED_SINCE = 59
HTTP_QUERY_MAX_FORWARDS = 60
HTTP_QUERY_PROXY_AUTHORIZATION = 61
HTTP_QUERY_RANGE = 62
HTTP_QUERY_TRANSFER_ENCODING = 63
HTTP_QUERY_UPGRADE = 64
HTTP_QUERY_VARY = 65
HTTP_QUERY_VIA = 66
HTTP_QUERY_WARNING = 67
HTTP_QUERY_EXPECT = 68
HTTP_QUERY_PROXY_CONNECTION  = 69
HTTP_QUERY_UNLESS_MODIFIED_SINCE = 70
HTTP_QUERY_ECHO_REQUEST = 71
HTTP_QUERY_ECHO_REPLY = 72
HTTP_QUERY_ECHO_HEADERS = 73
HTTP_QUERY_ECHO_HEADERS_CRLF = 74
HTTP_QUERY_PROXY_SUPPORT = 75
HTTP_QUERY_AUTHENTICATION_INFO = 76
HTTP_QUERY_PASSPORT_URLS = 77
HTTP_QUERY_PASSPORT_CONFIG = 78
HTTP_QUERY_MAX = 78
HTTP_QUERY_CUSTOM = 65535
HTTP_QUERY_FLAG_REQUEST_HEADERS  = 0x80000000
HTTP_QUERY_FLAG_SYSTEMTIME = 0x40000000
HTTP_QUERY_FLAG_NUMBER = 0x20000000
HTTP_QUERY_FLAG_COALESCE = 0x10000000
HTTP_QUERY_MODIFIER_FLAGS_MASK = (HTTP_QUERY_FLAG_REQUEST_HEADERS or\
				  HTTP_QUERY_FLAG_SYSTEMTIME or\
				  HTTP_QUERY_FLAG_NUMBER or\
				  HTTP_QUERY_FLAG_COALESCE)

HTTP_QUERY_HEADER_MASK = not HTTP_QUERY_MODIFIER_FLAGS_MASK

HTTP_STATUS_CONTINUE = 100
HTTP_STATUS_SWITCH_PROTOCOLS = 101
HTTP_STATUS_OK = 200
HTTP_STATUS_CREATED = 201
HTTP_STATUS_ACCEPTED = 202
HTTP_STATUS_PARTIAL = 203
HTTP_STATUS_NO_CONTENT = 204
HTTP_STATUS_RESET_CONTENT = 205
HTTP_STATUS_PARTIAL_CONTENT = 206
HTTP_STATUS_AMBIGUOUS = 300
HTTP_STATUS_MOVED = 301
HTTP_STATUS_REDIRECT = 302
HTTP_STATUS_REDIRECT_METHOD = 303
HTTP_STATUS_NOT_MODIFIED = 304
HTTP_STATUS_USE_PROXY = 305
HTTP_STATUS_REDIRECT_KEEP_VERB = 307
HTTP_STATUS_BAD_REQUEST = 400
HTTP_STATUS_DENIED = 401
HTTP_STATUS_PAYMENT_REQ = 402
HTTP_STATUS_FORBIDDEN = 403
HTTP_STATUS_NOT_FOUND = 404
HTTP_STATUS_BAD_METHOD = 405
HTTP_STATUS_NONE_ACCEPTABLE = 406
HTTP_STATUS_PROXY_AUTH_REQ = 407
HTTP_STATUS_REQUEST_TIMEOUT = 408
HTTP_STATUS_CONFLICT = 409
HTTP_STATUS_GONE = 410
HTTP_STATUS_LENGTH_REQUIRED = 411
HTTP_STATUS_PRECOND_FAILED = 412
HTTP_STATUS_REQUEST_TOO_LARGE = 413
HTTP_STATUS_URI_TOO_LONG = 414
HTTP_STATUS_UNSUPPORTED_MEDIA = 415
HTTP_STATUS_RETRY_WITH = 449
HTTP_STATUS_SERVER_ERROR = 500
HTTP_STATUS_NOT_SUPPORTED = 501
HTTP_STATUS_BAD_GATEWAY = 502
HTTP_STATUS_SERVICE_UNAVAIL = 503
HTTP_STATUS_GATEWAY_TIMEOUT = 504
HTTP_STATUS_VERSION_NOT_SUP = 505
HTTP_STATUS_FIRST = HTTP_STATUS_CONTINUE
HTTP_STATUS_LAST = HTTP_STATUS_VERSION_NOT_SUP

HTTP_ADDREQ_INDEX_MASK = $FFFF
HTTP_ADDREQ_FLAGS_MASK = $FFFF0000
HTTP_ADDREQ_FLAG_ADD_IF_NEW = $10000000
HTTP_ADDREQ_FLAG_ADD = $20000000
HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA = $40000000
HTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON = $1000000
HTTP_ADDREQ_FLAG_COALESCE = HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA
HTTP_ADDREQ_FLAG_REPLACE = $80000000

HSR_ASYNC = WININET_API_FLAG_ASYNC
HSR_SYNC = WININET_API_FLAG_SYNC
HSR_USE_CONTEXT = WININET_API_FLAG_USE_CONTEXT
HSR_INITIATE = 8
HSR_DOWNLOAD = $10
HSR_CHUNKED = $20

INTERNET_COOKIE_IS_SECURE = 1
INTERNET_COOKIE_IS_SESSION = 2
INTERNET_COOKIE_THIRD_PARTY = $10
INTERNET_COOKIE_PROMPT_REQUIRED = $20
INTERNET_COOKIE_EVALUATE_P3P = $40
INTERNET_COOKIE_APPLY_P3P = $80
INTERNET_COOKIE_P3P_ENABLED = $100
INTERNET_COOKIE_IS_RESTRICTED = $200
INTERNET_COOKIE_IE6 = $400
INTERNET_COOKIE_IS_LEGACY = $800

FLAG_ICC_FORCE_CONNECTION = 1

FLAGS_ERROR_UI_FILTER_FOR_ERRORS = 1
FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS = 2
FLAGS_ERROR_UI_FLAGS_GENERATE_DATA = 4
FLAGS_ERROR_UI_FLAGS_NO_UI = 8
FLAGS_ERROR_UI_SERIALIZE_DIALOGS = $10

struct INTERNETAUTHNOTIFYDATA
       cbStruct dd ?
       dwOptions dd ?
       pfnNotify dq ?
       dwContext dq ?
ends

INTERNET_ERROR_BASE = 12000
ERROR_INTERNET_OUT_OF_HANDLES = (INTERNET_ERROR_BASE + 1)
ERROR_INTERNET_TIMEOUT = (INTERNET_ERROR_BASE + 2)
ERROR_INTERNET_EXTENDED_ERROR = (INTERNET_ERROR_BASE + 3)
ERROR_INTERNET_INTERNAL_ERROR = (INTERNET_ERROR_BASE + 4)
ERROR_INTERNET_INVALID_URL = (INTERNET_ERROR_BASE + 5)
ERROR_INTERNET_UNRECOGNIZED_SCHEME = (INTERNET_ERROR_BASE + 6)
ERROR_INTERNET_NAME_NOT_RESOLVED = (INTERNET_ERROR_BASE + 7)
ERROR_INTERNET_PROTOCOL_NOT_FOUND = (INTERNET_ERROR_BASE + 8)
ERROR_INTERNET_INVALID_OPTION = (INTERNET_ERROR_BASE + 9)
ERROR_INTERNET_BAD_OPTION_LENGTH = (INTERNET_ERROR_BASE + 10)
ERROR_INTERNET_OPTION_NOT_SETTABLE = (INTERNET_ERROR_BASE + 11)
ERROR_INTERNET_SHUTDOWN = (INTERNET_ERROR_BASE + 12)
ERROR_INTERNET_INCORRECT_USER_NAME = (INTERNET_ERROR_BASE + 13)
ERROR_INTERNET_INCORRECT_PASSWORD = (INTERNET_ERROR_BASE + 14)
ERROR_INTERNET_LOGIN_FAILURE = (INTERNET_ERROR_BASE + 15)
ERROR_INTERNET_INVALID_OPERATION = (INTERNET_ERROR_BASE + 16)
ERROR_INTERNET_OPERATION_CANCELLED = (INTERNET_ERROR_BASE + 17)
ERROR_INTERNET_INCORRECT_HANDLE_TYPE = (INTERNET_ERROR_BASE + 18)
ERROR_INTERNET_INCORRECT_HANDLE_STATE = (INTERNET_ERROR_BASE + 19)
ERROR_INTERNET_NOT_PROXY_REQUEST = (INTERNET_ERROR_BASE + 20)
ERROR_INTERNET_REGISTRY_VALUE_NOT_FOUND = (INTERNET_ERROR_BASE + 21)
ERROR_INTERNET_BAD_REGISTRY_PARAMETER = (INTERNET_ERROR_BASE + 22)
ERROR_INTERNET_NO_DIRECT_ACCESS = (INTERNET_ERROR_BASE + 23)
ERROR_INTERNET_NO_CONTEXT = (INTERNET_ERROR_BASE + 24)
ERROR_INTERNET_NO_CALLBACK = (INTERNET_ERROR_BASE + 25)
ERROR_INTERNET_REQUEST_PENDING = (INTERNET_ERROR_BASE + 26)
ERROR_INTERNET_INCORRECT_FORMAT = (INTERNET_ERROR_BASE + 27)
ERROR_INTERNET_ITEM_NOT_FOUND = (INTERNET_ERROR_BASE + 28)
ERROR_INTERNET_CANNOT_CONNECT = (INTERNET_ERROR_BASE + 29)
ERROR_INTERNET_CONNECTION_ABORTED = (INTERNET_ERROR_BASE + 30)
ERROR_INTERNET_CONNECTION_RESET = (INTERNET_ERROR_BASE + 31)
ERROR_INTERNET_FORCE_RETRY = (INTERNET_ERROR_BASE + 32)
ERROR_INTERNET_INVALID_PROXY_REQUEST = (INTERNET_ERROR_BASE + 33)
ERROR_INTERNET_NEED_UI = (INTERNET_ERROR_BASE + 34)
ERROR_INTERNET_HANDLE_EXISTS = (INTERNET_ERROR_BASE + 36)
ERROR_INTERNET_SEC_CERT_DATE_INVALID = (INTERNET_ERROR_BASE + 37)
ERROR_INTERNET_SEC_CERT_CN_INVALID = (INTERNET_ERROR_BASE + 38)
ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR = (INTERNET_ERROR_BASE + 39)
ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR = (INTERNET_ERROR_BASE + 40)
ERROR_INTERNET_MIXED_SECURITY = (INTERNET_ERROR_BASE + 41)
ERROR_INTERNET_CHG_POST_IS_NON_SECURE = (INTERNET_ERROR_BASE + 42)
ERROR_INTERNET_POST_IS_NON_SECURE = (INTERNET_ERROR_BASE + 43)
ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED = (INTERNET_ERROR_BASE + 44)
ERROR_INTERNET_INVALID_CA = (INTERNET_ERROR_BASE + 45)
ERROR_INTERNET_CLIENT_AUTH_NOT_SETUP = (INTERNET_ERROR_BASE + 46)
ERROR_INTERNET_ASYNC_THREAD_FAILED = (INTERNET_ERROR_BASE + 47)
ERROR_INTERNET_REDIRECT_SCHEME_CHANGE = (INTERNET_ERROR_BASE + 48)
ERROR_INTERNET_DIALOG_PENDING = (INTERNET_ERROR_BASE + 49)
ERROR_INTERNET_RETRY_DIALOG = (INTERNET_ERROR_BASE + 50)
ERROR_INTERNET_HTTPS_HTTP_SUBMIT_REDIR = (INTERNET_ERROR_BASE + 52)
ERROR_INTERNET_INSERT_CDROM = (INTERNET_ERROR_BASE + 53)
ERROR_INTERNET_FORTEZZA_LOGIN_NEEDED = (INTERNET_ERROR_BASE + 54)
ERROR_INTERNET_SEC_CERT_ERRORS = (INTERNET_ERROR_BASE + 55)
ERROR_INTERNET_SEC_CERT_NO_REV = (INTERNET_ERROR_BASE + 56)
ERROR_INTERNET_SEC_CERT_REV_FAILED = (INTERNET_ERROR_BASE + 57)

ERROR_FTP_TRANSFER_IN_PROGRESS = (INTERNET_ERROR_BASE + 110)
ERROR_FTP_DROPPED = (INTERNET_ERROR_BASE + 111)
ERROR_FTP_NO_PASSIVE_MODE = (INTERNET_ERROR_BASE + 112)

ERROR_GOPHER_PROTOCOL_ERROR = (INTERNET_ERROR_BASE + 130)
ERROR_GOPHER_NOT_FILE = (INTERNET_ERROR_BASE + 131)
ERROR_GOPHER_DATA_ERROR = (INTERNET_ERROR_BASE + 132)
ERROR_GOPHER_END_OF_DATA = (INTERNET_ERROR_BASE + 133)
ERROR_GOPHER_INVALID_LOCATOR = (INTERNET_ERROR_BASE + 134)
ERROR_GOPHER_INCORRECT_LOCATOR_TYPE = (INTERNET_ERROR_BASE + 135)
ERROR_GOPHER_NOT_GOPHER_PLUS = (INTERNET_ERROR_BASE + 136)
ERROR_GOPHER_ATTRIBUTE_NOT_FOUND = (INTERNET_ERROR_BASE + 137)
ERROR_GOPHER_UNKNOWN_LOCATOR = (INTERNET_ERROR_BASE + 138)

ERROR_HTTP_HEADER_NOT_FOUND = (INTERNET_ERROR_BASE + 150)
ERROR_HTTP_DOWNLEVEL_SERVER = (INTERNET_ERROR_BASE + 151)
ERROR_HTTP_INVALID_SERVER_RESPONSE = (INTERNET_ERROR_BASE + 152)
ERROR_HTTP_INVALID_HEADER = (INTERNET_ERROR_BASE + 153)
ERROR_HTTP_INVALID_QUERY_REQUEST = (INTERNET_ERROR_BASE + 154)
ERROR_HTTP_HEADER_ALREADY_EXISTS = (INTERNET_ERROR_BASE + 155)
ERROR_HTTP_REDIRECT_FAILED = (INTERNET_ERROR_BASE + 156)
ERROR_HTTP_NOT_REDIRECTED = (INTERNET_ERROR_BASE + 160)
ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION = (INTERNET_ERROR_BASE + 161)
ERROR_HTTP_COOKIE_DECLINED = (INTERNET_ERROR_BASE + 162)
ERROR_HTTP_REDIRECT_NEEDS_CONFIRMATION = (INTERNET_ERROR_BASE + 168)

ERROR_INTERNET_SECURITY_CHANNEL_ERROR = (INTERNET_ERROR_BASE + 157)
ERROR_INTERNET_UNABLE_TO_CACHE_FILE = (INTERNET_ERROR_BASE + 158)
ERROR_INTERNET_TCPIP_NOT_INSTALLED = (INTERNET_ERROR_BASE + 159)
ERROR_INTERNET_DISCONNECTED = (INTERNET_ERROR_BASE + 163)
ERROR_INTERNET_SERVER_UNREACHABLE = (INTERNET_ERROR_BASE + 164)
ERROR_INTERNET_PROXY_SERVER_UNREACHABLE = (INTERNET_ERROR_BASE + 165)
ERROR_INTERNET_BAD_AUTO_PROXY_SCRIPT = (INTERNET_ERROR_BASE + 166)
ERROR_INTERNET_UNABLE_TO_DOWNLOAD_SCRIPT = (INTERNET_ERROR_BASE + 167)
ERROR_INTERNET_SEC_INVALID_CERT = (INTERNET_ERROR_BASE + 169)
ERROR_INTERNET_SEC_CERT_REVOKED = (INTERNET_ERROR_BASE + 170)
ERROR_INTERNET_FAILED_DUETOSECURITYCHECK = (INTERNET_ERROR_BASE + 171)
ERROR_INTERNET_NOT_INITIALIZED = (INTERNET_ERROR_BASE + 172)
ERROR_INTERNET_NEED_MSN_SSPI_PKG = (INTERNET_ERROR_BASE + 173)
ERROR_INTERNET_LOGIN_FAILURE_DISPLAY_ENTITY_BODY  = (INTERNET_ERROR_BASE + 174)
INTERNET_ERROR_LAST = ERROR_INTERNET_LOGIN_FAILURE_DISPLAY_ENTITY_BODY

NORMAL_CACHE_ENTRY = 1
STICKY_CACHE_ENTRY = 4
EDITED_CACHE_ENTRY = 8
TRACK_OFFLINE_CACHE_ENTRY = $10
TRACK_ONLINE_CACHE_ENTRY = $20
SPARSE_CACHE_ENTRY = $10000
COOKIE_CACHE_ENTRY = $100000
URLHISTORY_CACHE_ENTRY = $200000
URLCACHE_FIND_DEFAULT_FILTER = NORMAL_CACHE_ENTRY or COOKIE_CACHE_ENTRY or URLHISTORY_CACHE_ENTRY or\
			       TRACK_OFFLINE_CACHE_ENTRY or TRACK_ONLINE_CACHE_ENTRY or\
			       STICKY_CACHE_ENTRY

struct INTERNETCACHEENTRYINFOA
       dwStructSize dd ?,?
       lpszSourceUrlName dq ?
       lpszLocalFileName dq ?
       CacheEntryType dd ?
       dwUseCount dd ?
       dwHitRate dd ?
       dwSizeLow dd ?
       dwSizeHigh dd ?
       LastModifiedTime FILETIME
       ExpireTime FILETIME
       LastAccessTime FILETIME
       LastSyncTime FILETIME
       dd ?
       lpHeaderInfo dq ?
       dwHeaderInfoSize dd ?,?
       lpszFileExtension dq ?
       union
	   dwReserved dd ?
	   dwExemptDelta dd ?
       ends
       dd ?
ends

struct INTERNETCACHEENTRYINFOW
       dwStructSize dd ?,?
       lpszSourceUrlName dq ?
       lpszLocalFileName dq ?
       CacheEntryType dd ?
       dwUseCount dd ?
       dwHitRate dd ?
       dwSizeLow dd ?
       dwSizeHigh dd ?
       LastModifiedTime FILETIME
       ExpireTime FILETIME
       LastAccessTime FILETIME
       LastSyncTime FILETIME
       dd ?
       lpHeaderInfo dq ?
       dwHeaderInfoSize dd ?,?
       lpszFileExtension dq ?
       union
	   dwReserved dd ?
	   dwExemptDelta dd ?
       ends
       dd ?
ends

struct INTERNETCACHETIMESTAMPS
       ftExpires FILETIME
       ftLastModified FILETIME
ends

CACHEGROUP_ATTRIBUTE_GET_ALL = $ffffffff
CACHEGROUP_ATTRIBUTE_BASIC = 1
CACHEGROUP_ATTRIBUTE_FLAG = 2
CACHEGROUP_ATTRIBUTE_TYPE = 4
CACHEGROUP_ATTRIBUTE_QUOTA = 8
CACHEGROUP_ATTRIBUTE_GROUPNAME = $10
CACHEGROUP_ATTRIBUTE_STORAGE = $20
CACHEGROUP_FLAG_NONPURGEABLE = 1
CACHEGROUP_FLAG_GIDONLY = 4
CACHEGROUP_FLAG_FLUSHURL_ONDELETE = 2
CACHEGROUP_SEARCH_ALL = 0
CACHEGROUP_SEARCH_BYURL = 1
CACHEGROUP_TYPE_INVALID = 1
CACHEGROUP_READWRITE_MASK =  CACHEGROUP_ATTRIBUTE_TYPE or CACHEGROUP_ATTRIBUTE_QUOTA or\
			     CACHEGROUP_ATTRIBUTE_GROUPNAME or CACHEGROUP_ATTRIBUTE_STORAGE

GROUPNAME_MAX_LENGTH = 120
GROUP_OWNER_STORAGE_SIZE = 4

struct INTERNETCACHEGROUPINFOA
       dwGroupSize dd ?
       dwGroupFlags dd ?
       dwGroupType dd ?
       dwDiskUsage dd ?
       dwDiskQuota dd ?
       dwOwnerStorage dd GROUP_OWNER_STORAGE_SIZE dup(?)
       szGroupName db GROUPNAME_MAX_LENGTH dup(?)
ends

struct INTERNETCACHEGROUPINFOW
       dwGroupSize dd ?
       dwGroupFlags dd ?
       dwGroupType dd ?
       dwDiskUsage dd ?
       dwDiskQuota dd ?
       dwOwnerStorage dd GROUP_OWNER_STORAGE_SIZE dup(?)
       szGroupName du GROUPNAME_MAX_LENGTH dup(?)
ends

CACHE_ENTRY_ATTRIBUTE_FC = 4
CACHE_ENTRY_HITRATE_FC = $10
CACHE_ENTRY_MODTIME_FC = $40
CACHE_ENTRY_EXPTIME_FC = $80
CACHE_ENTRY_ACCTIME_FC = $100
CACHE_ENTRY_SYNCTIME_FC = $200
CACHE_ENTRY_HEADERINFO_FC = $400
CACHE_ENTRY_EXEMPT_DELTA_FC = $800

INTERNET_CACHE_GROUP_ADD = 0
INTERNET_CACHE_GROUP_REMOVE = 1

INTERNET_DIAL_FORCE_PROMPT = $2000
INTERNET_DIAL_SHOW_OFFLINE = $4000
INTERNET_DIAL_UNATTENDED = $8000

INTERENT_GOONLINE_REFRESH = 1
INTERENT_GOONLINE_MASK = 1

INTERNET_AUTODIAL_FORCE_ONLINE = 1
INTERNET_AUTODIAL_FORCE_UNATTENDED = 2
INTERNET_AUTODIAL_FAILIFSECURITYCHECK = 4
INTERNET_AUTODIAL_OVERRIDE_NET_PRESENT = 8
INTERNET_AUTODIAL_FLAGS_MASK = (INTERNET_AUTODIAL_FORCE_ONLINE or\
				INTERNET_AUTODIAL_FORCE_UNATTENDED or\
				INTERNET_AUTODIAL_FAILIFSECURITYCHECK or\
				INTERNET_AUTODIAL_OVERRIDE_NET_PRESENT)

PROXY_AUTO_DETECT_TYPE_DHCP = 1
PROXY_AUTO_DETECT_TYPE_DNS_A = 2

struct AUTOPROXYHELPERVTBL
       IsResolvable dq ?
       GetIPAddress dq ?
       ResolveHostName dq ?
       IsInNet dq ?
       IsResolvableEx dq ?
       GetIPAddressEx dq ?
       ResolveHostNameEx dq ?
       IsInNetEx dq ?
       SortIpList dq ?
ends

struct AUTOPROXYSCRIPTBUFFER
       dwStructSize dd ?,?
       lpszScriptBuffer dq ?
       dwScriptBufferSize dd ?,?
ends

struct AutoProxyHelperFunctions
       lpVtbl dq ?
ends

INTERNET_CONNECTION_MODEM = 1
INTERNET_CONNECTION_LAN = 2
INTERNET_CONNECTION_PROXY = 4
INTERNET_CONNECTION_MODEM_BUSY = 8
INTERNET_RAS_INSTALLED = $10
INTERNET_CONNECTION_OFFLINE = $20
INTERNET_CONNECTION_CONFIGURED = $40

INTERNET_CUSTOMDIAL_CONNECT = 0
INTERNET_CUSTOMDIAL_UNATTENDED = 1
INTERNET_CUSTOMDIAL_DISCONNECT = 2
INTERNET_CUSTOMDIAL_SHOWOFFLINE = 4
INTERNET_CUSTOMDIAL_SAFE_FOR_UNATTENDED = 1
INTERNET_CUSTOMDIAL_WILL_SUPPLY_STATE = 2
INTERNET_CUSTOMDIAL_CAN_HANGUP = 4

INTERNET_DIALSTATE_DISCONNECTED = 1

INTERNET_IDENTITY_FLAG_PRIVATE_CACHE = 1
INTERNET_IDENTITY_FLAG_SHARED_CACHE = 2
INTERNET_IDENTITY_FLAG_CLEAR_DATA = 4
INTERNET_IDENTITY_FLAG_CLEAR_COOKIES = 8
INTERNET_IDENTITY_FLAG_CLEAR_HISTORY = $10
INTERNET_IDENTITY_FLAG_CLEAR_CONTENT = $20

INTERNET_SUPPRESS_RESET_ALL = 0
INTERNET_SUPPRESS_COOKIE_POLICY = 1
INTERNET_SUPPRESS_COOKIE_POLICY_RESET = 2

PRIVACY_TEMPLATE_NO_COOKIES = 0
PRIVACY_TEMPLATE_HIGH = 1
PRIVACY_TEMPLATE_MEDIUM_HIGH = 2
PRIVACY_TEMPLATE_MEDIUM = 3
PRIVACY_TEMPLATE_MEDIUM_LOW = 4
PRIVACY_TEMPLATE_LOW = 5
PRIVACY_TEMPLATE_CUSTOM = 100
PRIVACY_TEMPLATE_ADVANCED = 101
PRIVACY_TEMPLATE_MAX = PRIVACY_TEMPLATE_LOW

PRIVACY_TYPE_FIRST_PARTY = 0
PRIVACY_TYPE_THIRD_PARTY = 1


;shellapi.h -  SHELL.DLL functions, types, and definitions
;Copyright (c) Microsoft Corporation. All rights reserved.

struct DRAGINFOA
       uSize dd ?
       pt POINT
       fNC dd ?
       lpFileList dq ?
       grfKeyState dd ?,?
ends

struct DRAGINFOW
       uSize dd ?
       pt POINT
       fNC dd ?
       lpFileList dq ?
       grfKeyState dd ?,?
ends

ABM_NEW = 0
ABM_REMOVE = 1
ABM_QUERYPOS = 2
ABM_SETPOS = 3
ABM_GETSTATE = 4
ABM_GETTASKBARPOS = 5
ABM_ACTIVATE = 6
ABM_GETAUTOHIDEBAR = 7
ABM_SETAUTOHIDEBAR = 8
ABM_WINDOWPOSCHANGED = 9
ABM_SETSTATE = $a

ABN_STATECHANGE = 0
ABN_POSCHANGED = 1
ABN_FULLSCREENAPP = 2
ABN_WINDOWARRANGE = 3

ABS_AUTOHIDE = 1
ABS_ALWAYSONTOP = 2

ABE_LEFT = 0
ABE_TOP = 1
ABE_RIGHT = 2
ABE_BOTTOM = 3

struct APPBARDATA
       cbSize dd ?,?
       hWnd dq ?
       uCallbackMessage dd ?
       uEdge dd ?
       rc RECT
       lParam dq ?
ends

FO_MOVE = 1
FO_COPY = 2
FO_DELETE = 3
FO_RENAME = 4

FOF_MULTIDESTFILES = 1
FOF_CONFIRMMOUSE = 2
FOF_SILENT = 4
FOF_RENAMEONCOLLISION = 8
FOF_NOCONFIRMATION = $10
FOF_WANTMAPPINGHANDLE = $20
FOF_ALLOWUNDO = $40
FOF_FILESONLY = $80
FOF_SIMPLEPROGRESS = $100
FOF_NOCONFIRMMKDIR = $200
FOF_NOERRORUI = $400
FOF_NOCOPYSECURITYATTRIBS = $800
FOF_NORECURSION = $1000
FOF_NO_CONNECTED_ELEMENTS = $2000
FOF_WANTNUKEWARNING = $4000
FOF_NORECURSEREPARSE = $8000

PO_DELETE = $13
PO_RENAME = $14
PO_PORTCHANGE = $20
PO_REN_PORT = $34

struct SHFILEOPSTRUCTA
       hwnd dq ?
       wFunc dd ?,?
       pFrom dq ?
       pTo dq ?
       fFlags dd ?
       fAnyOperationsAborted dd ?
       hNameMappings dq ?
       lpszProgressTitle dq ?
ends

struct SHFILEOPSTRUCTW
       hwnd dq ?
       wFunc dd ?,?
       pFrom dq ?
       pTo dq ?
       fFlags dd ?
       fAnyOperationsAborted dd ?
       hNameMappings dq ?
       lpszProgressTitle dq ?
ends

struct SHNAMEMAPPINGA
       pszOldPath dq ?
       pszNewPath dq ?
       cchOldPath dd ?
       cchNewPath dd ?
ends

struct SHNAMEMAPPINGW
       pszOldPath dq ?
       pszNewPath dq ?
       cchOldPath dd ?
       cchNewPath dd ?
ends

SE_ERR_FNF = 2
SE_ERR_PNF = 3
SE_ERR_ACCESSDENIED = 5
SE_ERR_OOM = 8
SE_ERR_DLLNOTFOUND = 32
SE_ERR_SHARE = 26
SE_ERR_ASSOCINCOMPLETE	= 27
SE_ERR_DDETIMEOUT = 28
SE_ERR_DDEFAIL = 29
SE_ERR_DDEBUSY = 30
SE_ERR_NOASSOC = 31

SEE_MASK_CLASSNAME = 1
SEE_MASK_CLASSKEY = 3
SEE_MASK_IDLIST = 4
SEE_MASK_INVOKEIDLIST = $c
SEE_MASK_ICON = $10
SEE_MASK_HOTKEY = $20
SEE_MASK_NOCLOSEPROCESS = $40
SEE_MASK_CONNECTNETDRV = $80
SEE_MASK_FLAG_DDEWAIT = $100
SEE_MASK_DOENVSUBST = $200
SEE_MASK_FLAG_NO_UI = $400
SEE_MASK_UNICODE = $4000
SEE_MASK_NO_CONSOLE = $8000
SEE_MASK_ASYNCOK = $100000
SEE_MASK_HMONITOR = $200000
SEE_MASK_NOZONECHECKS = $800000
SEE_MASK_NOQUERYCLASSSTORE = $1000000
SEE_MASK_WAITFORINPUTIDLE = $2000000
SEE_MASK_FLAG_LOG_USAGE = $4000000

struct SHELLEXECUTEINFOA
       cbSize dd ?
       fMask dd ?
       hwnd dq ?
       lpVerb dq ?
       lpFile dq ?
       lpParameters dq ?
       lpDirectory dq ?
       nShow dd ?,?
       hInstApp dq ?
       lpIDList dq ?
       lpClass dq ?
       hkeyClass dq ?
       dwHotKey dd ?,?
       union
	   hIcon dq ?
	   hMonitor dq ?
       ends
       hProcess dq ?
ends

struct SHELLEXECUTEINFOW
       cbSize dd ?
       fMask dd ?
       hwnd dq ?
       lpVerb dq ?
       lpFile dq ?
       lpParameters dq ?
       lpDirectory dq ?
       nShow dd ?,?
       hInstApp dq ?
       lpIDList dq ?
       lpClass dq ?
       hkeyClass dq ?
       dwHotKey dd ?,?
       union
	   hIcon dq ?
	   hMonitor dq ?
       ends
       hProcess dq ?
ends

struct SHCREATEPROCESSINFOW
       cbSize dd ?
       fMask dd ?
       hwnd dq ?
       pszFile dq ?
       pszParameters dq ?
       pszCurrentDirectory dq ?
       hUserToken dq ?
       lpProcessAttributes dq ?
       lpThreadAttributes dq ?
       bInheritHandles dd ?
       dwCreationFlags dd ?
       lpStartupInfo dq ?
       lpProcessInformation dq ?
ends

struct SHQUERYRBINFO
       cbSize dd ?,?
       i64Size dq ?
       i64NumItems dq ?
ends

SHERB_NOCONFIRMATION = 1
SHERB_NOPROGRESSUI = 2
SHERB_NOSOUND = 4

struct NOTIFYICONDATAA
       cbSize dd ?,?
       hWnd dq ?
       uID dd ?
       uFlags dd ?
       uCallbackMessage dd ?,?
       hIcon dq ?
       szTip db 128 dup(?)
       dwState dd ?
       dwStateMask dd ?
       szInfo db 256 dup(?)
       union
	   uTimeout dd ?
	   uVersion dd ?
       ends
       szInfoTitle db 64 dup(?)
       dwInfoFlags dd ?
       guidItem GUID
       hBalloonIcon dq ?
ends

struct NOTIFYICONDATAW
       cbSize dd ?,?
       hWnd dq ?
       uID dd ?
       uFlags dd ?
       uCallbackMessage dd ?,?
       hIcon dq ?
       szTip du 128 dup(?)
       dwState dd ?
       dwStateMask dd ?
       szInfo du 256 dup(?)
       union
	   uTimeout dd ?
	   uVersion dd ?
       ends
       szInfoTitle du 64 dup(?)
       dwInfoFlags dd ?
       guidItem GUID
       hBalloonIcon dq ?
ends

NIN_SELECT = (WM_USER + 0)
NINF_KEY = 1
NIN_KEYSELECT = (NIN_SELECT or NINF_KEY)
NIN_BALLOONSHOW = (WM_USER + 2)
NIN_BALLOONHIDE = (WM_USER + 3)
NIN_BALLOONTIMEOUT = (WM_USER + 4)
NIN_BALLOONUSERCLICK = (WM_USER + 5)

NIM_ADD = 0
NIM_MODIFY = 1
NIM_DELETE = 2
NIM_SETFOCUS = 3
NIM_SETVERSION = 4
NOTIFYICON_VERSION = 3

NIF_MESSAGE = 1
NIF_ICON = 2
NIF_TIP = 4
NIF_STATE = 8
NIF_INFO = $10
NIF_GUID = $20

NIS_HIDDEN = 1
NIS_SHAREDICON = 2

NIIF_NONE = 0
NIIF_INFO = 1
NIIF_WARNING = 2
NIIF_ERROR = 3
NIIF_USER = 4
NIIF_ICON_MASK = $F
NIIF_NOSOUND = $10

struct SHFILEINFOA
       hIcon dq ?
       iIcon dd ?
       dwAttributes dd ?
       szDisplayName db MAX_PATH dup(?)
       szTypeName db 80 dup(?)
       pad1 dd ?
ends

struct SHFILEINFOW
       hIcon dq ?
       iIcon dd ?
       dwAttributes dd ?
       szDisplayName du MAX_PATH dup(?)
       szTypeName du 80 dup(?)
ends

SHGFI_ICON = $100
SHGFI_DISPLAYNAME  = $200
SHGFI_TYPENAME = $400
SHGFI_ATTRIBUTES = $800
SHGFI_ICONLOCATION = $1000
SHGFI_EXETYPE = $2000
SHGFI_SYSICONINDEX = $4000
SHGFI_LINKOVERLAY = $8000
SHGFI_SELECTED = $10000
SHGFI_ATTR_SPECIFIED = $20000
SHGFI_LARGEICON = 0
SHGFI_SMALLICON = 1
SHGFI_OPENICON = 2
SHGFI_SHELLICONSIZE = 4
SHGFI_PIDL = 8
SHGFI_USEFILEATTRIBUTES = $10
SHGFI_ADDOVERLAYS = $20
SHGFI_OVERLAYINDEX = $40

SHGNLI_PIDL = 1
SHGNLI_PREFIXNAME = 2
SHGNLI_NOUNIQUE = 4
SHGNLI_NOLNK = 8

PRINTACTION_OPEN = 0
PRINTACTION_PROPERTIES = 1
PRINTACTION_NETINSTALL = 2
PRINTACTION_NETINSTALLLINK = 3
PRINTACTION_TESTPAGE = 4
PRINTACTION_OPENNETPRN = 5
PRINTACTION_DOCUMENTDEFAULTS = 6
PRINTACTION_SERVERPROPERTIES = 7

OFFLINE_STATUS_LOCAL = 1
OFFLINE_STATUS_REMOTE = 2
OFFLINE_STATUS_INCOMPLETE = 4

SHIL_LARGE = 0
SHIL_SMALL = 1
SHIL_EXTRALARGE = 2
SHIL_SYSSMALL = 3
SHIL_LAST = SHIL_SYSSMALL


;CLSID_TaskbarList GUID $56FDF344, $FD6D, $11d0, <$95,$8A,0,$60,$97,$C9,$A0,$90>
;IID_ITaskbarList GUID $56FDF342, $FD6D, $11d0, <$95,$8A,0,$60,$97,$C9,$A0,$90>
;IID_IPersistIDList GUID $1079acfc, $29bd, $11d3, <$8e,$d,0,$c0,$4f,$68,$37,$d5>
;CLSID_ShellDesktop GUID $21400, 0, 0, <$C0, 0, 0, 0, 0, 0, 0, $46>
;CLSID_NetworkPlaces GUID $208D2C60, $3AEA, $1069, <$A2,$D7,8,0,$2B,$30,$30,$9D>
;CLSID_NetworkDomain GUID $46e06680, $4bf0, $11d1, <$83,$ee,0,$a0,$c9,$d,$c8,$49>
;CLSID_NetworkServer GUID $c0542a90, $4bf0, $11d1, <$83,$ee,0,$a0,$c9,$d,$c8,$49>
;CLSID_NetworkShare GUID $54a754c0, $4bf0, $11d1, <$83,$ee,0,$a0,$c9,$d,$c8,$49>
;CLSID_MyComputer GUID $20D04FE0, $3AEA, $1069, <$A2,$D8,8,0,$2B,$30,$30,$9D>
;CLSID_Internet GUID $871C5380, $42A0, $1069, <$A2,$EA,8,0,$2B,$30,$30,$9D>
;CLSID_ShellFSFolder GUID $F3364BA0, $65B9, $11CE, <$A9,$BA,0,$AA,0,$4A,$E8,$37>
;CLSID_RecycleBin GUID $645FF040, $5081, $101B, <$9F,$08,0,$AA,0,$2F,$95,$4E>
;CLSID_ControlPanel GUID $21EC2020, $3AEA, $1069, <$A2,$DD,8,0,$2B,$30,$30,$9D>
;CLSID_Printers GUID $2227A280, $3AEA, $1069, <$A2,$DE,8,0,$2B,$30,$30,$9D>
;CLSID_MyDocumets GUID $450d8fba, $ad25, $11d0, <$98,$a8,8,0,$36,$1b,$11,$03>
;CATID_BrowsableShellExt GUID $21490, 0, 0, <$C0,0,0,0,0,0,0,$46>
;CATID_BrowseInPlace GUID $21491, 0, 0, <$C0,0,0,0,0,0,0,$46>
;CATID_DeskBand GUID $21492, 0, 0, <$C0,0,0,0,0,0,0,$46>
;CATID_InfoBand GUID $21493, 0, 0, <$C0,0,0,0,0,0,0,$46>
;CATID_CommBand GUID $21494, 0, 0, <$C0,0,0,0,0,0,0,$46>
;PSGUID_INTERNETSHORTCUT GUID $214A0, 0, 0, <$C0,0,0,0,0,0,0,$46>
;FMTID_Intshcut GUID $214A0, 0, 0, <$C0,0,0,0,0,0,0,$46>
;PSGUID_INTERNETSITE GUID $214A1, 0, 0, <$C0,0,0,0,0,0,0,$46>
;FMTID_InternetSite GUID $214A1, 0, 0, <$C0,0,0,0,0,0,0,$46>
;CGID_Explorer GUID $214D0, 0, 0, <$C0,0,0,0,0,0,0,$46>
;CGID_ShellDocView GUID $214D1, 0, 0, <$C0,0,0,0,0,0,0,$46>
;CGID_ShellServiceObject GUID $214D2, 0, 0, <$C0,0,0,0,0,0,0,$46>
;CGID_ExplorerBarDoc GUID $214D3, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_INewShortcutHookA GUID $214E1, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_IShellBrowser GUID $214E2, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_IShellView GUID $214E3, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_IContextMenu GUID $214E4, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_IShellIcon GUID $214E5, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_IShellFolder GUID $214E6, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_IShellExtInit GUID $214E8, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_IShellPropSheetExt GUID $214E9, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_IPersistFolder GUID $214EA, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_IExtractIconA GUID $214EB, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_IShellDetails GUID $214EC, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_IDelayedRelease GUID $214ED, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_IShellLinkA GUID $214EE, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_IShellCopyHookA GUID $214EF, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_IFileViewerA GUID $214F0, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_ICommDlgBrowser GUID $214F1, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_IEnumIDList GUID $214F2, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_IFileViewerSite GUID $214F3, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_IContextMenu2 GUID $214F4, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_IShellExecuteHookA GUID $214F5, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_IPropSheetPage GUID $214F6, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_INewShortcutHookW GUID $214F7, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_IFileViewerW GUID $214F8, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_IShellLinkW GUID $214F9, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_IExtractIconW GUID $214FA, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_IShellExecuteHookW GUID $214FB, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_IShellCopyHookW GUID $214FC, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_IRemoteComputer GUID $214FE, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_IQueryInfo GUID $21500, 0, 0, <$C0,0,0,0,0,0,0,$46>
;IID_IBriefcaseStg GUID $8BCE1FA1, $0921, $101B, <$B1,$FF,0,$DD,$1,$C,$CC,$48>
;IID_IShellView2 GUID $88E39E80, $3578, $11CF, <$AE,$69,8,0,$2B,$2E,$12,$62>
;IID_IShellLinkDataList GUID $45e2b4ae, $b1c3, $11d0, <$b9,$2f,0,$a0,$c9,3,$12,$e1>
;IID_IResolveShellLink GUID $5cd52983, $9449, $11d2, <$96,$3a,0,$c0,$4f,$79,$ad,$f0>
;IID_IURLSearchHook GUID $AC60F6A0, $0FD9, $11D0, <$99,$CB,0,$C0,$4F,$D6,$44,$97>
;IID_ISearchContext GUID $09F656A2, $41AF, $480C, <$88,$F7,$16,$CC,$D,$16,$46,$15>
;IID_IURLSearchHook2 GUID $5ee44da4, $6d32, $46e3, <$86,$bc,7,$54,$d,$ed,$d0,$e0>
;IID_IDefViewID GUID $985F64F0, $D410, $4E02, <$BE,$22,$DA,7,$F2,$B5,$C5,$E1>
;CLSID_ShellTaskScheduler GUID $603d3800, $bd81, $11d0, <$a3,$a5,0,$c0,$4f,$d7,6,$ec>
;IID_IShellTaskScheduler GUID $6ccb7be0, $6807, $11d0, <$b8,$10,0,$c0,$4f,$d7,6,$ec>
;CLSID_FolderShortcut GUID $AFACED1, $E828, $11D1, <$91,$87,$B5,$32,$F1,$E9,$57,$5D>
;CLSID_StgFolder GUID $E773F1AF, $3A65, $4866, <$85,$7D,$84,$6F,$C9,$C4,$59,$8A>
;IID_IInputObject GUID $68284faa, $6a48, $11d0, <$8c,$78,0,$c0,$4f,$d9,$18,$b4>
;IID_IInputObjectSite GUID $f1db8392, $7331, $11d0, <$8c,$99,0,$a0,$c9,$2d,$bf,$e8>
;IID_IDockingWindowSite GUID $2a342fc2, $7b26, $11d0, <$8c,$a9,0,$a0,$c9,$2d,$bf,$e8>
;IID_IDockingWindowFrame GUID $47d2657a, $7b27, $11d0, <$8c,$a9,0,$a0,$c9,$2d,$bf,$e8>
;IID_IShellIconOverlay GUID $7D688A70, $C613, $11D0, <$99,$9B,0,$C0,$4F,$D6,$55,$E1>
;IID_IShellIconOverlayIdentifier GUID $C6C4200L, $C589, $11D0, <$99,$9A,0,$C0,$4F,$D6,$55,$E1>
;IID_ICommDlgBrowser2 GUID $10339516, $2894, $11d2, <$90,$39,0,$c0,$4f,$8e,$eb,$3e>
;IID_IShellFolderViewCB GUID $2047E320, $F2A9, $11CE, <$AE,$65,8,0,$2B,$2E,$12,$62>
;IID_IPersistFolder3 GUID $cef04fdf, $fe72, $11d2, <$87,$a5,0,$c0,$4f,$68,$37,$cf>
;CLSID_CFSIconOverlayManager GUID $63B51F81, $C868, $11D0, <$99,$9C,0,$C0,$4F,$D6,$55,$E1>
;IID_IShellIconOverlayManager GUID $f10b5e34, $dd3b, $42a7, <$aa,$7d,$2f,$4e,$c5,$4b,$b0,$9b>
;IID_IRunnableTask GUID $85788d00, $6807, $11d0, <$b8,$10,0,$c0,$4f,$d7,6,$ec>
;IID_IThumbnailCapture GUID $4ea39266, $7211, $409f, <$b6,$22,$f6,$3d,$bd,$16,$c5,$33>
;IID_IShellImageStore GUID $48c8118c, $b924, $11d1, <$98,$d5,0,$c0,$4f,$b6,$87,$da>
;IID_IEnumShellImageStore GUID $6dfd582b, $92e3, $11d1, <$98,$a3,0,$c0,$4f,$b6,$87,$da>
;CLSID_ShellThumbnailDiskCache GUID $1ebdcf80, $a200, $11d0, <$a3,$a4,0,$c0,$4f,$d7,6,$ec>
;IID_IContextMenu3 GUID $bcfce0a0, $ec17, $11d0, <$8d,$10,0,$a0,$c9,$f,$27,$19>
;SID_DefView GUID $6D12FE80, $7911, $11CF, <$95,$34,0,0,$C0,$5B,$AE,$B>
;CGID_DefView GUID $4af07f10, $d231, $11d0, <$b9,$42,0,$a0,$c9,$3,$12,$e1>
;CLSID_MenuBand GUID $5b4dae26, $b807, $11d0, <$98,$15,0,$c0,$4f,$d9,$19,$72>
;IID_IShellFolderBand GUID $7fe80cc8, $c247, $11d0, <$b9,$3a,0,$a0,$c9,$3,$12,$e1>
;IID_IDefViewFrame GUID $710EB7A0, $45ED, $11D0, <$92,$4A,0,$20,$AF,$C7,$AC,$4D>
;VID_LargeIcons GUID $0057D0E0, $3573, $11CF, <$AE,$69,8,0,$2B,$2E,$12,$62>
;VID_SmallIcons GUID $089000C0, $3573, $11CF, <$AE,$69,8,0,$2B,$2E,$12,$62>
;VID_List GUID $0E1FA5E0, $3573, $11CF, <$AE,$69,8,0,$2B,$2E,$12,$62>
;VID_Details GUID $137E7700, $3573, $11CF, <$AE,$69,8,0,$2B,$2E,$12,$62>
;VID_Tile GUID $65f125e5, $7be1, $4810, <$ba,$9d,$d2,$71,$c8,$43,$2c,$e3>
;VID_Thumbnails GUID $8bebb290, $52d0, $11d0, <$b7,$f4,0,$c0,$4f,$d7,6,$ec>
;VID_ThumbStrip GUID $8EEFA624, $D1E9, $445B, <$94,$B7,$74,$FB,$CE,$2E,$A1,$1A>
;IID_IDiscardableBrowserProperty GUID $49c3de7c, $d329, $11d0, <$ab,$73,0,$c0,$4f,$c3,$3e,$80>
;IID_IShellChangeNotify GUID $D82BE2B1L, $5764, $11D0, <$A9,$6E,0,$C0,$4F,$D7,5,$A2>
;IID_IAutoCompList GUID $00BB2760L, $6A77, $11D0, <$A5,$35,0,$C0,$4F,$D7,$D0,$62>
;IID_IObjMgr GUID $00BB2761L, $6A77, $11D0, <$A5,$35,0,$C0,$4F,$D7,$D0,$62>
;IID_IACList GUID $77A130B0L, $94FD, $11D0, <$A5,$44,0,$C0,$4F,$D7,$d0,$62>
;IID_IACList2 GUID $470141a0L, $5186, $11d2, <$bb,$b6,0,$60,$97,$7b,$46,$4c>
;IID_ICurrentWorkingDirectory GUID $91956d21L, $9276, $11d1, <$92,$1a,0,$60,$97,$df,$5b,$d4>
;CLSID_AutoComplete GUID $00BB2763L, $6A77, $11D0, <$A5,$35,0,$C0,$4F,$D7,$D0,$62>
;CLSID_ACLHistory GUID $00BB2764L, $6A77, $11D0, <$A5,$35,0,$C0,$4F,$D7,$D0,$62>
;CLSID_ACListISF GUID $03C036F1L, $A186, $11D0, <$82,$4A,0,$AA,0,$5B,$43,$83>
;CLSID_ACLMRU GUID $6756a641L, $de71, $11d0, <$83,$1b,0,$aa,0,$5b,$43,$83>
;CLSID_ACLMulti GUID $BB2765L,   $6A77, $11D0, <$A5,$35,0,$C0,$4F,$D7,$D0,$62>
;CLSID_ACLCustomMRU GUID $6935db93, $21e8, $4ccc, <$be,$b9,$9f,$e3,$c7,$7a,$29,$7a>
;CLSID_ProgressDialog GUID $f8383852, $fcd3, $11d1, <$a6,$b9,0,$60,$97,$df,$5b,$d4>
;IID_IProgressDialog GUID $ebbc7c04, $315e, $11d2, <$b6,$2f,0,$60,$97,$df,$5b,$d4>
;SID_STopLevelBrowser GUID $4C96BE40, $915C, $11CF, <$99,$D3,0,$AA,0,$4A,$E8,$37>
;CLSID_FileTypes GUID $B091E540, $83E3, $11CF, <$A7,$13,0,$20,$AF,$D7,$97,$62>
;CLSID_ActiveDesktop GUID $75048700, $EF1F, $11D0, <$98,$88,0,$60,$97,$DE,$AC,$F9>
;IID_IActiveDesktop GUID $F490EB00, $1240, $11D1, <$98,$88,0,$60,$97,$DE,$AC,$F9>
;IID_IActiveDesktopP GUID $52502EE0, $EC80, $11D0, <$89,$AB,0,$C0,$4F,$C2,$97,$2D>
;IID_IADesktopP2 GUID $b22754e2, $4574, $11d1, <$98,$88,0,$60,$97,$de,$ac,$f9>
;IID_ISynchronizedCallBack GUID $74c26041, $70d1, $11d1, <$b7,$5a,0,$a0,$c9,5,$64,$fe>
;IID_IShellDetails3 GUID $d2a105c0, $87d5, $11d1, <$83,$91,0,0,$f8,4,$61,$cf>
;IID_IQueryAssociations GUID $c46ca590, $3c3f, $11d2, <$be,$e6,0,0,$f8,5,$ca,$57>
;CLSID_QueryAssociations GUID $a07034fd, $6caa, $4954, <$ac,$3f,97,$a2,$72,$16,$f9,$8a>
;IID_IColumnProvider GUID $e8025004, $1c42, $11d2, <$be,$2c,0,$a0,$c9,$a8,$3d,$a1>
;CLSID_DocFileColumnProvider GUID $24f14f01, $7b1c, $11d1, <$83,$8f,0,0,$f8,$4,$61,$cf>
;CLSID_LinkColumnProvider GUID $24f14f02, $7b1c, $11d1, <$83,$8f,0,0,$f8,$4,$61,$cf>
;CLSID_FileSysColumnProvider GUID $d2e74c4, $3c34, $11d2, <$a2,$7e,0,$c0,$4f,$c3,8,$71>
;CGID_ShortCut GUID $93a68750, $951a, $11d1, <$94,$6f,0,0,0,0,0,0>
;IID_INamedPropertyBag GUID $fb700430, $952c, $11d1, <$94,$6f,0,0,0,0,0,0>
;CLSID_InternetButtons GUID $1E796980, $9CC5, $11D1, <$A8,$3F,0,$C0,$4F,$C9,$9D,$61>
;CLSID_MSOButtons GUID $178f34b8, $a282, $11d2, <$86,$c5,0,$c0,$4f,$8e,$ea,$99>
;CLSID_ToolbarExtButtons GUID $2ce4b5d8, $a28f, $11d2, <$86,$c5,0,$c0,$4f,$8e,$ea,$99>
;CLSID_DarwinAppPublisher GUID $CFCCC7A0, $A282, $11D1, <$90,$82,0,$60,$08,$05,$93,$82>
;CLSID_DocHostUIHandler GUID $7057e952, $bd1b, $11d1, <$89,$19,0,$c0,$4f,$c2,$c8,$36>
;IID_IShellFolder2 GUID $93f2f68c, $1d1b, $11d3, <$a3,$e,0,$c0,$4f,$79,$ab,$d1>
;FMTID_ShellDetails GUID $28636aa6, $953d, $11d2, <$b5,$d6,0,$c0,$4f,$d9,$18,$d0>
;FMTID_Storage GUID $b725f130, $47ef, $101a, <$a5,$f1,2,$60,$8c,$9e,$eb,$ac>
;FMTID_ImageProperties GUID $14b81da1, $0135, $4d31, <$96,$d9,$6c,$bf,$c9,$67,$1a,$99>
;FMTID_Displaced GUID $9b174b33, $40ff, $11d2, <$a2,$7e,0,$c0,$4f,$c3,$8,$71>
;FMTID_Briefcase GUID $328d8b21, $7729, $4bfc, <$95,$4c,90,$2b,$32,$9d,$56,$b0>
;FMTID_Misc GUID $9b174b34, $40ff, $11d2, <$a2,$7e,0,$c0,$4f,$c3,$8,$71>
;FMTID_WebView GUID $f2275480, $f782, $4291, <$bd,$94,$f1,$36,$93,$51,$3a,$ec>
;FMTID_MUSIC GUID $56a3372e, $ce9c, $11d2, <$9f,$e,0,$60,$97,$c6,$86,$f6>
;FMTID_DRM GUID $aeac19e4, $89ae, $4508, <$b9,$b7,$bb,$86,$7a,$be,$e2,$ed>
;PSGUID_VIDEO GUID $64440491, $4c8b, $11d1, <$8b,$70,8,$0,$36,$b1,$1a,$3>
;PSGUID_AUDIO GUID $64440490, $4c8b, $11d1, <$8b,$70,8,$0,$36,$b1,$1a,$3>
;PSGUID_CONTROLPANEL GUID $305ca226, $d286, $468e, <$b8,$48,$2b,$2e,$8e,$69,$7b,$74>
;FMTID_Volume GUID $9b174b35, $40ff, $11d2, <$a2,$7e,0,$c0,$4f,$c3,8,$71>
;PSGUID_SHARE GUID $d8c3986f, $813b, $449c, <$84,$5d,$87,$b9,$5d,$67,$4a,$de>
;PSGUID_LINK GUID $b9b4b3fc, $2b51, $4a42, <$b5,$d8,$32,$41,$46,$af,$cf,$25>
;FMTID_Query GUID $49691c90, $7e17, $101a, <$a9,$1c,8,0,$2b,$2e,$cd,$a9>
;PSGUID_SUMMARYINFORMATION GUID $f29f85e0, $4ff9, $1068, <$ab,$91,8,0,$2b,$27,$b3,$d9>
;PSGUID_DOCUMENTSUMMARYINFORMATION GUID $d5cdd502, $2e9c, $101b, <$93,$97,8,0,$2b,$2c,$f9,$ae>
;PSGUID_MEDIAFILESUMMARYINFORMATION GUID $64440492, $4c8b, $11d1, <$8b,$70,8,0,$36,$b1,$1a,3>
;PSGUID_IMAGESUMMARYINFORMATION GUID $6444048f, $4c8b, $11d1, <$8b,$70,8,0,$36,$b1,$1a,3>
;IID_IEnumExtraSearch GUID $e700be1,  $9db6, $11d1, <$a1,$ce,0,$c0,$4f,$d7,$5d,$13>
;CLSID_MountedVolume GUID $12518493, $00B2, $11d2, <$9F,$A5,$9E,$34,$20,$52,$41,$53>
;CLSID_HWShellExecute GUID $ffb8655f, $81b9, $4fce, <$b8,$9c,$9a,$6b,$a7,$6d,$13,$e7>
;IID_IMountedVolume GUID $12518492, $00B2, $11d2, <$9F,$A5,$9E,$34,$20,$52,$41,$53>
;CLSID_DragDropHelper GUID $4657278a, $411b, $11d2, <$83,$9a,0,$c0,$4f,$d9,$18,$d0>
;IID_IDropTargetHelper GUID $4657278b, $411b, $11d2, <$83,$9a,0,$c0,$4f,$d9,$18,$d0>
;IID_IDragSourceHelper GUID $de5bf786, $477a, $11d2, <$83,$9d,0,$c0,$4f,$d9,$18,$d0>
;CLSID_CAnchorBrowsePropertyPage GUID  $3050f3BB, $98b5, $11cf, <$bb,$82,0,$aa,0,$bd,$ce,$b>
;CLSID_CImageBrowsePropertyPage GUID $3050f3B3, $98b5, $11cf, <$bb,$82,0,$aa,0,$bd,$ce,$b>
;CLSID_CDocBrowsePropertyPage GUID $3050f3B4, $98b5, $11cf, <$bb,$82,0,$aa,0,$bd,$ce,$b>
;IID_IFileSystemBindData GUID $1e18d10,  $4d8b, $11d2, <$85,$5d,0,$60,8,5,$93,$67>
;SID_STopWindow GUID $49e1b500, $4636, $11d3, <$97,$f7,0,$c0,$4f,$45,$d0,$b3>
;SID_SGetViewFromViewDual GUID $889A935D, $971E, $4B12, <$B9,$C,$24,$DF,$C9,$E1,$E5,$E8>
;CLSID_FolderItem GUID $fef10fa2, $355e, $4e06, <$93,$81,$9b,$24,$d7,$f7,$cc,$88>
;CLSID_FolderItemsFDF GUID $53c74826, $ab99, $4d33, <$ac,$a4,$31,$17,$f5,$1d,$37,$88>
;CLSID_NewMenu GUID $d969a300, $e7ff, $11d0, <$a9,$3b,0,$a0,$c9,$f,$27,$19>
;BHID_SFObject GUID $3981e224, $f559, $11d3, <$8e,$3a,0,$c0,$4f,$68,$37,$d5>
;BHID_SFUIObject GUID $3981e225, $f559, $11d3, <$8e,$3a,0,$c0,$4f,$68,$37,$d5>
;BHID_SFViewObject GUID $3981e226, $f559, $11d3, <$8e,$3a,0,$c0,$4f,$68,$37,$d5>
;BHID_Storage  GUID $3981e227, $f559, $11d3, <$8e,$3a,0,$c0,$4f,$68,$37,$d5>
;BHID_Stream GUID $1cebb3ab, $7c10, $499a, <$a4,$17,$92,$ca,$16,$c4,$cb,$83>
;BHID_LinkTargetItem GUID $3981e228, $f559, $11d3, <$8e,$3a,0,$c0,$4f,$68,$37,$d5>
;BHID_StorageEnum GUID $4621a4e3, $f0d6, $4773, <$8a,$9c,$46,$e7,$7b,$17,$48,$40>
;SID_CtxQueryAssociations GUID $faadfc40, $b777, $4b69, <$aa,$81,$77,$03,$5e,$f0,$e6,$e8>
;IID_IDocViewSite GUID $87D605E0, $C511, $11CF, <$89,$A9,0,$A0,$C9,$05,$41,$29>
;CLSID_QuickLinks GUID $e5cbf21,  $d15f, $11d0, <$83,1,0,$aa,0,$5b,$43,$83>
;CLSID_ISFBand GUID $D82BE2B0, $5764, $11D0, <$A9,$6E,0,$C0,$4F,$D7,$05,$A2>
;IID_CDefView GUID $4434FF80, $EF4C, $11CE, <$AE,$65,8,0,$2B,$2E,$12,$62>
;CLSID_ShellFldSetExt GUID $6D5313C0, $8C62, $11D1, <$B2,$CD,0,$60,$97,$DF,$8C,$11>
;SID_SMenuBandChild GUID $ed9cc020, $8b9,  $11d1, <$98,$23,0,$c0,$4f,$d9,$19,$72>
;SID_SMenuBandParent GUID $8c278eec, $3eab, $11d1, <$8c,$b0,0,$c0,$4f,$d9,$18,$d0>
;SID_SMenuPopup GUID $D1E7AFEB, $6A2E, $11d0, <$8C,$78,0,$C0,$4F,$D9,$18,$B4>
;SID_SMenuBandBottomSelected GUID $165ebaf4, $6d51, $11d2, <$83,$ad,0,$c0,$4f,$d9,$18,$d0>
;SID_SMenuBandBottom GUID $743ca664, $deb,  $11d1, <$98,$25,0,$c0,$4f,$d9,$19,$72>
;SID_MenuShellFolder GUID $a6c17eb4, $2d65, $11d2, <$83,$8f,0,$c0,$4f,$d9,$18,$d0>
;CGID_MENUDESKBAR GUID $5c9f0a12, $959e, $11d0, <$a3,$a4,0,$a0,$c9,8,$26,$36>
;SID_SMenuBandTop GUID $9493a810, $ec38, $11d0, <$bc,$46,0,$aa,0,$6c,$e2,$f5>
;CLSID_MenuToolbarBase GUID $40b96610, $b522, $11d1, <$b3,$b4,0,$aa,0,$6e,$fd,$e7>
;IID_IBanneredBar GUID $596a9a94, $13e,  $11d1, <$8d,$34,0,$a0,$c9,$f,$27,$19>
;CLSID_MenuBandSite GUID $e13ef4e4, $d2f2, $11d0, <$98,$16,0,$c0,$4f,$d9,$19,$72>
;SID_SCommDlgBrowser GUID $80f30233, $b7df, $11d2, <$a3,$3b,0,$60,$97,$df,$5b,$d4>
;IID_IFolderView GUID $cde725b0, $ccc9, $4519, <$91,$7e,$32,$5d,$72,$fa,$b4,$ce>
;IID_IFolderFilterSite GUID $C0A651F5, $B48B, $11d2, <$B5,$ED,0,$60,$97,$C6,$86,$F6>
;IID_IFolderFilter GUID $9CC22886, $DC8E, $11d2, <$B1,$D0,0,$C0,$4F,$8E,$EB,$3E>
;IID_IProfferService GUID $cb728b20, $f786, $11ce, <$92,$ad,0,$aa,0,$a7,$4c,$d0>
;IID_IPropertyUI GUID $757a7d9f, $919a, $4118, <$99,$d7,$db,$b2,8,$c8,$cc,$66>
;IID_ICategoryProvider GUID $9af64809, $5864, $4c26, <$a7,$20,$c1,$f7,$8c,8,$6e,$e3>
;IID_ICategorizer GUID $a3b14589, $9174, $49a8, <$89,$a3,6,$a1,$ae,$2b,$9b,$a7>
;IID_IActionProgressDialog GUID $49ff1172, $eadc, $446d, <$92,$85,$15,$64,$53,$a6,$43,$1c>
;IID_IHWEventHandler GUID $C1FB73D0, $EC3A, $4ba2, <$B5,$12,$8C,$DB,$91,$87,$B6,$D1>
;IID_IQueryCancelAutoPlay GUID $DDEFE873, $6997, $4e68, <$BE,$26,$39,$B6,$33,$AD,$BE,$12>
;IID_IActionProgress GUID $49ff1173, $eadc, $446d, <$92,$85,$15,$64,$53,$a6,$43,$1c>
;IID IID_IQueryContinue GUID $7307055c, $b24a, $486b, <$9f,$25,$16,$3e,$59,$7a,$28,$a9>
;IID_IUserNotification GUID $ba9711ba, $5893, $4787, <$a7,$e1,$41,$27,$71,$51,$55,$b>
;IID_IItemNameLimits GUID $1df0d7f1, $b267, $4d28, <$8b,$10,$12,$e2,$32,2,$a5,$c4>
;IID_IExtractImage GUID $BB2E617C, $920, $11d1, <$9A,$B,0,$C0,$4F,$C2,$D6,$C1>
;IID_IExtractImage2 GUID $953BB1EE, $93B4, $11d1, <$98,$A3,0,$C0,$4F,$B6,$87,$DA>
;IID_IUserEventTimerCallback GUID $e9ead8e6, $2a25, $410e, <$9b,$58,$a9,$fb,$ef,$1d,$d1,$a2>
;IID_IUserEventTimer GUID $F504B94, $6E42, $42E6, <$99,$E0,$E2,$F,$AF,$E5,$2A,$B4>
;IID_IDockingWindow GUID $12dd920, $7b26, $11d0, <$8c,$a9,0,$a0,$c9,$2d,$bf,$e8>
;IID_IDeskBand GUID $EB0FE172, $1A3A, $11D0, <$89,$B3,0,$A0,$C9,$A,$90,$AC>
;IID_ITaskbarList2 GUID $602D4995, $B13A, $429b, <$A6,$6E,$19,$35,$E4,$4F,$43,$17>
;IID_ICDBurn GUID $3d73a659, $e5d0, $4d42, <$af,$c0,$51,$21,$ba,$42,$5c,$8d>
;IID_IWizardSite GUID $88960f5b, $422f, $4e7b, <$80,$13,$73,$41,$53,$81,$c3,$c3>
;IID_IWizardExtension GUID $c02ea696, $86cc, $491e, <$9b,$23,$74,$39,$4a,4,$44,$a8>
;IID_IWebWizardExtension GUID $e6b3f66, $98d1, $48c0, <$a2,$22,$fb,$de,$74,$e2,$fb,$c5>
;IID_IPublishingWizard GUID $aa9198bb, $ccec, $472d, <$be,$ed,$19,$a4,$f6,$73,$3f,$7a>
;IID IID_IFolderViewHost GUID $1ea58f02, $d55a, $411d, <$b0,$9e,$9e,$65,$ac,$21,$60,$5b>
;IID_IAutoCompleteDropDown GUID $3CD141F4, $3C6A, $11d2, <$BC,$AA,0,$C0,$4F,$D9,$29,$DB>
;IID_IModalWindow GUID $b4db1657, $70d7, $485e, <$8e,$3e,$6f,$cb,$5a,$5c,$18,2>
;IID_IPassportWizard GUID $a09db586, $9180, $41ac, <$91,$14,$46,$a,$7f,$36,$2b,$76>
;IID_ICDBurnExt GUID $2271dcca, $74fc, $4414, <$8f,$b7,$c5,$6b,5,$ac,$e2,$d7>
;IID_IDVGetEnum GUID $70F55181, $5FEA, $4900, <$B6,$B8,$73,$43,$CB,$A,$34,$8C>
;IID_IInsertItem GUID $D2B57227, $3D23, $4b95, <$93,$C0,$49,$2B,$D4,$54,$C3,$56>
;IID_IDeskBar GUID $EB0FE173, $1A3A, $11D0, <$89,$B3,0,$A0,$C9,$A,$90,$AC>
;IID_IMenuBand GUID $568804CD, $CBD7, $11d0, <$98,$16,0,$C0,$4F,$D9,$19,$72>
;IID_IFolderBandPriv GUID $47c01f95, $e185, $412c, <$b5,$c5,$4f,$27,$df,$96,$5a,$ea>
;IID_IBandSite GUID $4CF504B0, $DE96, $11D0, <$8B,$3F,0,$A0,$C9,$11,$E8,$E5>
;IID_INamespaceWalkCB GUID $d92995f8, $cf5e, $4a76, <$bf,$59,$ea,$d3,$9e,$a2,$b9,$7e>
;IID_INamespaceWalk GUID $57ced8a7, $3f4a, $432c, <$93,$50,$30,$f2,$44,$83,$f7,$4f>
;IID_IRegTreeItem GUID $A9521922, $0812, $4d44, <$9E,$C3,$7F,$D3,$8C,$72,$6F,$3D>
;IID_IMenuPopup GUID $D1E7AFEB, $6A2E, $11d0, <$8C,$78,0,$C0,$4F,$D9,$18,$B4>
;IID_IShellItem GUID $43826d1e, $e718, $42ee, <$bc,$55,$a1,$e2,$61,$c3,$7b,$fe>
;IID_IImageRecompress GUID $505f1513, $6b3e, $4892, <$a2,$72,$59,$f8,$88,$9a,$4d,$3e>
;IID_IDefViewSafety GUID $9A93B3FB, $4E75, $4c74, <$87,$1A,$2C,$DA,$66,$7F,$39,$A5>
;IID_IContextMenuSite GUID $811AEBE, $B87, $4C54, <$9E,$72,$54,$8C,$F6,$49,1,$6B>
;IID_IDelegateFolder GUID $ADD8BA80, $2B, $11D0, <$8F,$F,0,$C0,$4F,$D7,$D0,$62>
;IID_IBrowserFrameOptions GUID $10DF43C8, $1DBE, $11d3, <$8B,$34,0,$60,$97,$DF,$5B,$D4>
;IID_INewWindowManager GUID $D2BC4C84, $3F72, $4a52, <$A6,4,$7B,$CB,$F3,$98,$2C,$BB>
;IID_IShellMenuCallback GUID $4CA300A1, $9B8D, $11d1, <$8B,$22,0,$C0,$4F,$D9,$18,$D0>
;IID IID_IAttachmentExecute GUID $73db1241, $1e85, $4581, <$8e,$4f,$a8,$1e,$1d,$0f,$8c,$57>
;IID_IShellMenu GUID $EE1F7637, $E138, $11d1, <$83,$79,0,$C0,$4F,$D9,$18,$D0>
;CLSID_QueryCancelAutoPlay GUID $331F1768, $05A9, $4ddd, <$B8,$6E,$DA,$E3,$4D,$DC,$99,$8A>
;CLSID_DriveSizeCategorizer GUID $94357B53, $CA29, $4b78, <$83,$AE,$E8,$FE,$74,9,$13,$4F>
;CLSID_DriveTypeCategorizer GUID $B0A8F3CF, $4333, $4bab, <$88,$73,$1C,$CB,$1C,$AD,$A4,$8B>
;CLSID_FreeSpaceCategorizer GUID $B5607793, $24AC, $44c7, <$82,$E2,$83,$17,$26,$AA,$6C,$B7>
;CLSID_TimeCategorizer GUID $3bb4118f, $ddfd, $4d30, <$a3,$48,$9f,$b5,$d6,$bf,$1a,$fe>
;CLSID_SizeCategorizer GUID $55d7b852, $f6d1, $42f2, <$aa,$75,$87,$28,$a1,$b2,$d2,$64>
;CLSID_AlphabeticalCategorizer GUID $3c2654c6, $7372, $4f6b, <$b3,$10,$55,$d6,$12,$8f,$49,$d2>
;CLSID_MergedCategorizer GUID $8e827c11, $33e7, $4bc1, <$b2,$42,$8c,$d9,$a1,$c2,$b3,4>
;CLSID_ImageProperties GUID $7ab770c7, $0e23, $4d7a, <$8a,$a2,$19,$bf,$ad,$47,$98,$29>
;CLSID_PropertiesUI GUID $d912f8cf, $0396, $4915, <$88,$4e,$fb,$42,$5d,$32,$94,$3b>
;CLSID_UserNotification GUID $10890e, $8789, $413c, <$ad,$bc,$48,$f5,$b5,$11,$b3,$af>
;CLSID_UserEventTimerCallback GUID $15fffd13, $5140, $41b8, <$b8,$9a,$c8,$d5,$75,$9c,$d2,$b2>
;CLSID CLSID_UserEventTimer GUID $864A1288, $354C, $4D19, <$9D,$68,$C2,$74,$2B,$B1,$49,$97>
;CLSID_NetCrawler GUID $601ac3dc, $786a, $4eb0, <$bf,$40,$ee,$35,$21,$e7,$b,$fb>
;CLSID_CDBurn GUID $fbeb8a05, $beee, $4442, <$80,$4e,$40,$9d,$6c,$45,$15,$e9>
;CLSID_TaskbarList GUID $56FDF344, $FD6D, $11d0, <$95,$8A,0,$60,$97,$C9,$A0,$90>
;CLSID_WebWizardHost GUID $c827f149, $55c1, $4d28, <$93,$5e,$57,$e4,$7c,$ae,$d9,$73>
;CLSID_PublishDropTarget GUID $CC6EEFFB, $43F6, $46c5, <$96,$19,$51,$D5,$71,$96,$7F,$7D>
;CLSID_PublishingWizard GUID $6b33163c, $76a5, $4b6c, <$bf,$21,$45,$de,$9c,$d5,3,$a1>
;CLSID_InternetPrintOrdering GUID $add36aa8, $751a, $4579, <$a2,$66,$d6,$6f,$52,2,$cc,$bb>
;CLSID_FolderViewHost GUID $20b1cb23, $6968, $4eb9, <$b7,$d4,$a6,$6d,0,$d0,$7c,$ee>
;CLSID_NamespaceWalker GUID $72eb61e0, $8672, $4303, <$91,$75,$f2,$e4,$c6,$8b,$2e,$7c>
;CLSID_ImageRecompress GUID $6e33091c, $d2f8, $4740, <$b5,$5e,$2e,$11,$d1,$47,$7a,$2c>
;CLSID_TrayBandSiteService GUID $F60AD0A0, $E5E1, $45cb, <$B5,$1A,$E1,$5B,$9F,$8B,$29,$34>
;CLSID_PassportWizard GUID $58f1f272, $9240, $4f51, <$b6,$d4,$fd,$63,$d1,$61,$85,$91>
;CLSID_AttachmentServices GUID $4125dd96, $e03a, $4103, <$8f,$70,$e0,$59,$7d,$80,$3b,$9c>

interface IPersistIDList,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetClassID,\
	  SetIDList,\
	  GetIDList

interface IEnumIDList,\
	  QueryInterface,\
	  AddRef,\
	  Next,\
	  Skip,\
	  Reset,\
	  Clone

interface ITaskbarList,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  HrInit,\
	  AddTab,\
	  DeleteTab,\
	  ActivateTab,\
	  SetActiveAlt

interface IShellFolder,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  ParseDisplayName,\
	  EnumObjects,\
	  BindToObject,\
	  BindToStorage,\
	  CompareIDs,\
	  CreateViewObject,\
	  GetAttributesOf,\
	  GetUIObjectOf,\
	  GetDisplayNameOf,\
	  SetNameOf

interface IEnumExtraSearch,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Next,\
	  Skip,\
	  Reset,\
	  Clone

interface IShellFolder2,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  ParseDisplayName,\
	  EnumObjects,\
	  BindToObject,\
	  BindToStorage,\
	  CompareIDs,\
	  CreateViewObject,\
	  GetAttributesOf,\
	  GetUIObjectOf,\
	  GetDisplayNameOf,\
	  SetNameOf,\
	  GetDefaultSearchGUID,\
	  EnumSearches,\
	  GetDefaultColumn,\
	  GetDefaultColumnState,\
	  GetDetailsEx,\
	  GetDetailsOf,\
	  MapColumnToSCID

interface IShellView,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetWindow,\
	  ContextSensitiveHelp,\
	  TranslateAccelerator,\
	  EnableModeless,\
	  UIActivate,\
	  Refresh,\
	  CreateViewWindow,\
	  DestroyViewWindow,\
	  GetCurrentInfo,\
	  AddPropertySheetPages,\
	  SaveViewState,\
	  SelectItem,\
	  GetItemObject

interface IShellView2,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetWindow,\
	  ContextSensitiveHelp,\
	  TranslateAccelerator,\
	  EnableModeless,\
	  UIActivate,\
	  Refresh,\
	  CreateViewWindow,\
	  DestroyViewWindow,\
	  GetCurrentInfo,\
	  AddPropertySheetPages,\
	  SaveViewState,\
	  SelectItem,\
	  GetItemObject,\
	  GetView,\
	  CreateViewWindow2,\
	  HandleRename,\
	  SelectAndPositionItem

interface IFolderView,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetCurrentViewMode,\
	  SetCurrentViewMode,\
	  GetFolder,\
	  Item,\
	  ItemCount,\
	  Items,\
	  GetSelectionMarkedItem,\
	  GetFocusedItem,\
	  GetItemPosition,\
	  GetSpacing,\
	  GetDefaultSpacing,\
	  GetAutoArrange,\
	  SelectItem,\
	  SelectAndPositionItems

interface IFolderFilterSite,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetFilter

interface IFolderFilter,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  ShouldShow,\
	  GetEnumFlags

interface IShellBrowser,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetWindow,\
	  ContextSensitiveHelp,\
	  InsertMenusSB,\
	  SetMenuSB,\
	  RemoveMenusSB,\
	  SetStatusTextSB,\
	  EnableModelessSB,\
	  TranslateAcceleratorSB,\
	  BrowseObject,\
	  GetViewStateStream,\
	  GetControlWindow,\
	  SendControlMsg,\
	  QueryActiveShellView,\
	  OnViewWindowActive,\
	  SetToolbarItems

interface IProfferService,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  ProfferService,\
	  RevokeService

interface IPropertyUI,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  ParsePropertyName,\
	  GetCannonicalName,\
	  GetDisplayName,\
	  GetPropertyDescription,\
	  GetDefaultWidth,\
	  GetFlags,\
	  FormatForDisplay,\
	  GetHelpInfo

interface ICategoryProvider,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  CanCategorizeOnSCID,\
	  GetDefaultCategory,\
	  GetCategoryForSCID,\
	  EnumCategories,\
	  GetCategoryName,\
	  CreateCategory

interface ICategorizer,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetDescription,\
	  GetCategory,\
	  GetCategoryInfo,\
	  CompareCategory

interface IShellLinkA,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetPath,\
	  GetIDList,\
	  SetIDList,\
	  GetDescription,\
	  SetDescription,\
	  GetWorkingDirectory,\
	  SetWorkingDirectory,\
	  GetArguments,\
	  SetArguments,\
	  GetHotkey,\
	  SetHotkey,\
	  GetShowCmd,\
	  SetShowCmd,\
	  GetIconLocation,\
	  SetIconLocation,\
	  SetRelativePath,\
	  Resolve,\
	  SetPath

interface IActionProgressDialog,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Initialize,\
	  Stop

interface IHWEventHandler,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Initialize,\
	  HandleEvent,\
	  HandleEventWithContent

interface IQueryCancelAutoPlay,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  AllowAutoPlay

interface IActionProgress,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Begin,\
	  UpdateProgress,\
	  UpdateText,\
	  QueryCancel,\
	  ResetCancel,\
	  End

interface IShellExtInit,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Initialize

interface IShellPropSheetExt,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  AddPages,\
	  ReplacePage

interface IRemoteComputer,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Initialize

interface IQueryContinue,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  QueryContinue

interface IUserNotification,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetBalloonInfo,\
	  SetBalloonRetry,\
	  SetIconInfo,\
	  Show,\
	  PlaySound

interface IItemNameLimits,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetValidCharacters,\
	  GetMaxLength

interface IExtractImage,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetLocation,\
	  Extract

interface IExtractImage2,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetLocation,\
	  Extract,\
	  GetDateStamp

interface IUserEventTimerCallback,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  UserEventTimerProc

interface IUserEventTimer,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetUserEventTimer,\
	  KillUserEventTimer,\
	  GetUserEventTimerElapsed,\
	  InitTimerTickInterval

interface IDockingWindow,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetWindow,\
	  ContextSensitiveHelp,\
	  ShowDW,\
	  CloseDW,\
	  ResizeBorderDW

interface IDeskBand,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetWindow,\
	  ContextSensitiveHelp,\
	  ShowDW,\
	  CloseDW,\
	  ResizeBorderDW,\
	  GetBandInfo

interface ITaskbarList2,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  HrInit,\
	  AddTab,\
	  DeleteTab,\
	  ActivateTab,\
	  SetActiveAlt,\
	  MarkFullscreenWindow

interface ICDBurn,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetRecorderDriveLetter,\
	  Burn,\
	  HasRecordableDrive

interface IWizardSite,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetPreviousPage,\
	  GetNextPage,\
	  GetCancelledPage

interface IWizardExtension,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  AddPages,\
	  GetFirstPage,\
	  GetLastPage

interface IWebWizardExtension,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  AddPages,\
	  GetFirstPage,\
	  GetLastPage,\
	  SetInitialURL,\
	  SetErrorURL

interface IPublishingWizard,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  AddPages,\
	  GetFirstPage,\
	  GetLastPage,\
	  Initialize,\
	  GetTransferManifest

interface IFolderViewHost,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Initialize

interface IAutoCompleteDropDown,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetDropDownStatus,\
	  ResetEnumerator

interface IModalWindow,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Show

interface IPassportWizard,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Show,\
	  SetOptions

interface ICDBurnExt,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetSupportedActionTypes

interface IDVGetEnum,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetEnumReadyCallback,\
	  CreateEnumIDListFromContents

interface IInsertItem,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  InsertItem

interface IDeskBar,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetWindow,\
	  ContextSensitiveHelp,\
	  SetClient,\
	  GetClient,\
	  OnPosRectChangeDB

interface IMenuBand,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  IsMenuMessage,\
	  TranslateMenuMessage

interface IFolderBandPriv,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetCascade,\
	  SetAccelerators,\
	  SetNoIcons,\
	  SetNoText

interface IBandSite,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  AddBand,\
	  EnumBands,\
	  QueryBand,\
	  SetBandState,\
	  RemoveBand,\
	  GetBandObject,\
	  SetBandSiteInfo,\
	  GetBandSiteInfo

interface INamespaceWalkCB,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  FoundItem,\
	  EnterFolder,\
	  LeaveFolder,\
	  InitializeProgressDialog

interface INamespaceWalk,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Walk,\
	  GetIDArrayResult

interface IRegTreeItem,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetCheckState,\
	  SetCheckState

interface IMenuPopup,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetWindow,\
	  ContextSensitiveHelp,\
	  SetClient,\
	  GetClient,\
	  OnPosRectChangeDB,\
	  Popup,\
	  OnSelect,\
	  SetSubMenu

interface IShellItem,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  BindToHandler,\
	  GetParent,\
	  GetDisplayName,\
	  GetAttributes,\
	  Compare

interface IImageRecompress,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  RecompressImage

interface IDefViewSafety,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  IsSafePage

interface IContextMenuSite,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  DoContextMenuPopup

interface IDelegateFolder,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetItemAlloc

interface IBrowserFrameOptions,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetFrameOptions

interface INewWindowManager,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  EvaluateNewWindow

interface IShellMenuCallback,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  CallbackSM

interface IAttachmentExecute,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetClientTitle,\
	  SetClientGuid,\
	  SetLocalPath,\
	  SetFileName,\
	  SetSource,\
	  SetReferrer,\
	  CheckPolicy,\
	  Prompt,\
	  Save,\
	  Execute,\
	  SaveWithUI,\
	  ClearClientState

interface IShellMenu,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Initialize,\
	  GetMenuInfo,\
	  SetShellFolder,\
	  GetShellFolder,\
	  SetMenu,\
	  GetMenu,\
	  InvalidateItem,\
	  GetState,\
	  SetMenuToolbar

SMINIT_DEFAULT = 0
SMINIT_RESTRICT_DRAGDROP = 2
SMINIT_TOPLEVEL = 4
SMINIT_CACHED = $10
SMINIT_VERTICAL = $10000000
SMINIT_HORIZONTAL = $20000000
ANCESTORDEFAULT = -1
SMSET_TOP = $10000000
SMSET_BOTTOM = $20000000
SMSET_DONTOWN = 1
SMINV_REFRESH = 1
SMINV_ID = 8

ATTACHMENT_PROMPT_NONE = 0
ATTACHMENT_PROMPT_SAVE = 1
ATTACHMENT_PROMPT_EXEC = 2
ATTACHMENT_PROMPT_EXEC_OR_SAVE = 3

ATTACHMENT_ACTION_CANCEL = 0
ATTACHMENT_ACTION_SAVE = 1
ATTACHMENT_ACTION_EXEC = 2

SMIM_TYPE = 1
SMIM_FLAGS = 2
SMIM_ICON = 4

SMIT_SEPARATOR = 1
SMIT_STRING = 2

SMIF_ICON = 1
SMIF_ACCELERATOR = 2
SMIF_DROPTARGET = 4
SMIF_SUBMENU = 8
SMIF_CHECKED = $20
SMIF_DROPCASCADE = $40
SMIF_HIDDEN = $80
SMIF_DISABLED = $100
SMIF_TRACKPOPUP = $200
SMIF_DEMOTED = $400
SMIF_ALTSTATE = $800
SMIF_DRAGNDROP = $1000
SMIF_NEW = $2000

SMC_INITMENU = 1
SMC_CREATE = 2
SMC_EXITMENU = 3
SMC_GETINFO = 5
SMC_GETSFINFO = 6
SMC_GETOBJECT = 7
SMC_GETSFOBJECT = 8
SMC_SFEXEC = 9
SMC_SFSELECTITEM = $A
SMC_REFRESH = $10
SMC_DEMOTE = $11
SMC_PROMOTE = $12
SMC_DEFAULTICON = $16
SMC_NEWITEM = $17
SMC_CHEVRONEXPAND = $19
SMC_DISPLAYCHEVRONTIP = $2A
SMC_SETSFOBJECT = $2D
SMC_SHCHANGENOTIFY = $2E
SMC_CHEVRONGETTIP = $2F
SMC_SFDDRESTRICTED = $30

SMDM_SHELLFOLDER = 1
SMDM_HMENU = 2
SMDM_TOOLBAR = 4

struct SMINFO
       dwMask dd ?
       dwType dd ?
       dwFlags dd ?
       iIcon dd ?
ends

struct SHCSCHANGENOTIFYSTRUCT
       lEvent dd ?,?
       pidl1 dq ?
       pidl2 dq ?
ends

struct SMDATA
       dwMask dd ?
       dwFlags dd ?
       hmenu dq ?
       hwnd dq ?
       uId dd ?
       uIdParent dd ?
       uIdAncestor dd ?,?
       punk dq ?
       pidlFolder dq ?
       pidlItem dq ?
       psf dq ?
       pvUserData dq ?
ends

NWMF_UNLOADING = 1
NWMF_USERINITED = 2
NWMF_FIRST = 4
NWMF_OVERRIDEKEY = 8
NWMF_SHOWHELP = $10
NWMF_HTMLDIALOG = $20
NWMF_FROMDIALOGCHILD = $40
NWMF_USERREQUESTED = $80
NWMF_USERALLOWED = $100

BFO_NONE = 0
BFO_BROWSER_PERSIST_SETTINGS = 1
BFO_RENAME_FOLDER_OPTIONS_TOINTERNET = 2
BFO_BOTH_OPTIONS = 4
BIF_PREFER_INTERNET_SHORTCUT = 8
BFO_BROWSE_NO_IN_NEW_PROCESS = $10
BFO_ENABLE_HYPERLINK_TRACKING = $20
BFO_USE_IE_OFFLINE_SUPPORT = $40
BFO_SUBSTITUE_INTERNET_START_PAGE = $80
BFO_USE_IE_LOGOBANDING = $100
BFO_ADD_IE_TOCAPTIONBAR = $200
BFO_USE_DIALUP_REF = $400
BFO_USE_IE_TOOLBAR = $800
BFO_NO_PARENT_FOLDER_SUPPORT = $1000
BFO_NO_REOPEN_NEXT_RESTART = $2000
BFO_GO_HOME_PAGE = $4000
BFO_PREFER_IEPROCESS = $8000
BFO_SHOW_NAVIGATION_CANCELLED = $10000
BFO_USE_IE_STATUSBAR = $20000
BFO_QUERY_ALL = $ffffffff

struct DELEGATEITEMID
       cbSize dw ?
       wOuter dw ?
       cbInner dw ?
       rgb db ?
ends

SIGDN_NORMALDISPLAY = 0
SIGDN_PARENTRELATIVEPARSING = $80018001
SIGDN_PARENTRELATIVEFORADDRESSBAR = $8001c001
SIGDN_DESKTOPABSOLUTEPARSING = $80028000
SIGDN_PARENTRELATIVEEDITING = $80031001
SIGDN_DESKTOPABSOLUTEEDITING = $8004c000
SIGDN_FILESYSPATH = $80058000
SIGDN_URL = $80068000

SICHINT_DISPLAY = 0
SICHINT_ALLFIELDS = $80000000
SICHINT_CANONICAL = $10000000

MPOS_EXECUTE = 0
MPOS_FULLCANCEL = MPOS_EXECUTE + 1
MPOS_CANCELLEVEL = MPOS_FULLCANCEL + 1
MPOS_SELECTLEFT = MPOS_CANCELLEVEL + 1
MPOS_SELECTRIGHT = MPOS_SELECTLEFT + 1
MPOS_CHILDTRACKING = MPOS_SELECTRIGHT + 1

MPPF_SETFOCUS = 1
MPPF_INITIALSELECT = 2
MPPF_NOANIMATE = 4
MPPF_KEYBOARD = $10
MPPF_REPOSITION = $20
MPPF_FORCEZORDER = $40
MPPF_FINALSELECT = $80
MPPF_TOP = $20000000
MPPF_LEFT = $40000000
MPPF_RIGHT = $60000000
MPPF_BOTTOM = $80000000
MPPF_POS_MASK = $e0000000

struct BANDSITEINFO
       dwMask dd ?
       dwState dd ?
       dwStyle dd ?
ends

NSWF_NONE_IMPLIES_ALL = 1
NSWF_ONE_IMPLIES_ALL = 2
NSWF_DONT_TRAVERSE_LINKS = 4
NSWF_DONT_ACCUMULATE_RESULT = 8
NSWF_TRAVERSE_STREAM_JUNCTIONS = $10
NSWF_FILESYSTEM_ONLY = $20
NSWF_SHOW_PROGRESS = $40
NSWF_FLAG_VIEWORDER = $80
NSWF_IGNORE_AUTOPLAY_HIDA = $100

BSID_BANDADDED = 0
BSID_BANDREMOVED = BSID_BANDADDED + 1
BSIM_STATE = 1
BSIM_STYLE = 2
BSSF_VISIBLE = 1
BSSF_NOTITLE = 2
BSSF_UNDELETEABLE = $1000
BSIS_AUTOGRIPPER = 0
BSIS_NOGRIPPER = 1
BSIS_ALWAYSGRIPPER = 2
BSIS_LEFTALIGN = 4
BSIS_SINGLECLICK = 8
BSIS_NOCONTEXTMENU = $10
BSIS_NODROPTARGET = $20
BSIS_NOCAPTION = $40
BSIS_PREFERNOLINEBREAK = $80
BSIS_LOCKED = $100

CDBE_RET_DEFAULT = 0
CDBE_RET_DONTRUNOTHEREXTS = 1
CDBE_RET_STOPWIZARD = 2
CDBE_TYPE_MUSIC = 1
CDBE_TYPE_DATA = 2
CDBE_TYPE_ALL = $ffffffff

SHPWHF_NORECOMPRESS = 1
SHPWHF_NONETPLACECREATE = 2
SHPWHF_NOFILESELECTOR = 4
SHPWHF_VALIDATEVIAWEBFOLDERS = $10000

DBIM_MINSIZE = 1
DBIM_MAXSIZE = 2
DBIM_INTEGRAL = 4
DBIM_ACTUAL = 8
DBIM_TITLE = $10
DBIM_MODEFLAGS = $20
DBIM_BKCOLOR = $40

struct DESKBANDINFO
       dwMask dd ?
       ptMinSize POINTL
       ptMaxSize POINTL
       ptIntegral POINTL
       ptActual POINTL
       wszTitle du 256 dup(?)
       dwModeFlags dd ?
       crBkgnd dd ?
ends

DBIMF_NORMAL = 0
DBIMF_FIXED = 1
DBIMF_FIXEDBMP = 4
DBIMF_VARIABLEHEIGHT = 8
DBIMF_UNDELETEABLE = $10
DBIMF_DEBOSSED = $20
DBIMF_BKCOLOR = $40
DBIMF_USECHEVRON = $80
DBIMF_BREAK = $100
DBIMF_ADDTOFRONT = $200
DBIMF_TOPALIGN = $400
DBIF_VIEWMODE_NORMAL = 0
DBIF_VIEWMODE_VERTICAL = 1
DBIF_VIEWMODE_FLOATING = 2
DBIF_VIEWMODE_TRANSPARENT = 4

DBID_BANDINFOCHANGED = 0
DBID_SHOWONLY = 1
DBID_MAXIMIZEBAND = 2
DBID_PUSHCHEVRON = 3
DBID_DELAYINIT = 4
DBID_FINISHINIT = 5
DBID_SETWINDOWTHEME = 6
DBID_PERMITAUTOHIDE = 7
DBPC_SELECTFIRST = -1
DBPC_SELECTLAST = -2

IEI_PRIORITY_MAX = ITSAT_MAX_PRIORITY
IEI_PRIORITY_MIN = ITSAT_MIN_PRIORITY
IEIT_PRIORITY_NORMAL = ITSAT_DEFAULT_PRIORITY
IEIFLAG_ASYNC = 1
IEIFLAG_CACHE = 2
IEIFLAG_ASPECT = 4
IEIFLAG_OFFLINE = 8
IEIFLAG_GLEAM = $10
IEIFLAG_SCREEN = $20
IEIFLAG_ORIGSIZE = $40
IEIFLAG_NOSTAMP = $80
IEIFLAG_NOBORDER = $100
IEIFLAG_QUALITY = $200
IEIFLAG_REFRESH = $400

SPBEGINF_NORMAL = 0
SPBEGINF_AUTOTIME = 2
SPBEGINF_NOPROGRESSBAR = $10
SPBEGINF_MARQUEEPROGRESS = $20

SPACTION_NONE = 0
SPACTION_MOVING = SPACTION_NONE + 1
SPACTION_COPYING = SPACTION_MOVING + 1
SPACTION_RECYCLING = SPACTION_COPYING + 1
SPACTION_APPLYINGATTRIBS = SPACTION_RECYCLING + 1
SPACTION_DOWNLOADING = SPACTION_APPLYINGATTRIBS + 1
SPACTION_SEARCHING_INTERNET = SPACTION_DOWNLOADING + 1
SPACTION_CALCULATING = SPACTION_SEARCHING_INTERNET + 1
SPACTION_UPLOADING = SPACTION_CALCULATING + 1
SPACTION_SEARCHING_FILES = SPACTION_UPLOADING + 1

SPTEXT_ACTIONDESCRIPTION = 1
SPTEXT_ACTIONDETAIL = SPTEXT_ACTIONDESCRIPTION + 1

ARCONTENT_AUTORUNINF = 2
ARCONTENT_AUDIOCD = 4
ARCONTENT_DVDMOVIE = 8
ARCONTENT_BLANKCD = $10
ARCONTENT_BLANKDVD = $20
ARCONTENT_UNKNOWNCONTENT = $40
ARCONTENT_AUTOPLAYPIX = $80
ARCONTENT_AUTOPLAYMUSIC = $100
ARCONTENT_AUTOPLAYVIDEO = $200

SPINITF_NORMAL = 0
SPINITF_MODAL = 1
SPINITF_NOMINIMIZE = 8

SLR_NO_UI = 1
SLR_ANY_MATCH = 2
SLR_UPDATE = 4
SLR_NOUPDATE = 8
SLR_NOSEARCH = $10
SLR_NOTRACK = $20
SLR_NOLINKINFO = $40
SLR_INVOKE_MSI = $80
SLR_NO_UI_WITH_MSG_PUMP = $101

SLGP_SHORTPATH = 1
SLGP_UNCPRIORITY = 2
SLGP_RAWPATH = 4

CATINFO_NORMAL = 0
CATINFO_COLLAPSED = 1
CATINFO_HIDDEN = 2

CATSORT_DEFAULT = 0
CATSORT_NAME = 1

PUIFNF_DEFAULT = 0
PUIFNF_MNEMONIC = 1

PUIF_DEFAULT = 0
PUIF_RIGHTALIGN = 1
PUIF_NOLABELININFOTIP = 2

PUIFFDF_DEFAULT = 0
PUIFFDF_RIGHTTOLEFT = 1
PUIFFDF_SHORTFORMAT = 2
PUIFFDF_NOTIME = 4
PUIFFDF_FRIENDLYDATE = 8
PUIFFDF_NOUNITS = $10

SBSP_DEFBROWSER = 0
SBSP_SAMEBROWSER = 1
SBSP_NEWBROWSER = 2
SBSP_DEFMODE = 0
SBSP_OPENMODE = $10
SBSP_EXPLOREMODE = $20
SBSP_HELPMODE = $40
SBSP_NOTRANSFERHIST = $80
SBSP_ABSOLUTE = 0
SBSP_RELATIVE = $1000
SBSP_PARENT = $2000
SBSP_NAVIGATEBACK = $4000
SBSP_NAVIGATEFORWARD = $8000
SBSP_ALLOW_AUTONAVIGATE = $10000
SBSP_CALLERUNTRUSTED = $800000
SBSP_TRUSTFIRSTDOWNLOAD = $1000000
SBSP_UNTRUSTEDFORDOWNLOAD = $2000000
SBSP_NOAUTOSELECT = $4000000
SBSP_WRITENOHISTORY = $8000000
SBSP_TRUSTEDFORACTIVEX = $10000000
SBSP_REDIRECT = $40000000
SBSP_INITIATEDBYHLINKFRAME = $80000000

FCW_STATUS = 1
FCW_TOOLBAR = 2
FCW_TREE = 3
FCW_INTERNETBAR = 6
FCW_PROGRESS = 8

FCT_MERGE = 1
FCT_CONFIGABLE = 2
FCT_ADDTOEND = 4

SVGIO_BACKGROUND = 0
SVGIO_SELECTION = 1
SVGIO_ALLVIEW = 2
SVGIO_CHECKED = 3
SVGIO_TYPE_MASK = $f
SVGIO_FLAG_VIEWORDER = $80000000

SVUIA_DEACTIVATE = 0
SVUIA_ACTIVATE_NOFOCUS = 1
SVUIA_ACTIVATE_FOCUS = 2
SVUIA_INPLACEACTIVATE = 3

SVSI_DESELECT = 0
SVSI_SELECT = 1
SVSI_EDIT = 3
SVSI_DESELECTOTHERS = 4
SVSI_ENSUREVISIBLE = 8
SVSI_FOCUSED = $10
SVSI_TRANSLATEPT = $20
SVSI_SELECTIONMARK = $40
SVSI_POSITIONITEM  = $80
SVSI_CHECK = $100
SVSI_NOSTATECHANGE = $80000000

FWF_AUTOARRANGE = 1
FWF_ABBREVIATEDNAMES = 2
FWF_SNAPTOGRID = 4
FWF_OWNERDATA = 8
FWF_BESTFITWINDOW = $10
FWF_DESKTOP = $20
FWF_SINGLESEL = $40
FWF_NOSUBFOLDERS = $80
FWF_TRANSPARENT = $100
FWF_NOCLIENTEDGE = $200
FWF_NOSCROLL = $400
FWF_ALIGNLEFT = $800
FWF_NOICONS = $1000
FWF_SHOWSELALWAYS = $2000
FWF_NOVISIBLE = $4000
FWF_SINGLECLICKACTIVATE = $8000
FWF_NOWEBVIEW = $10000
FWF_HIDEFILENAMES = $20000
FWF_CHECKSELECT = $40000

FVM_FIRST = 1
FVM_ICON = 1
FVM_SMALLICON = 2
FVM_LIST = 3
FVM_DETAILS = 4
FVM_THUMBNAIL = 5
FVM_TILE = 6
FVM_THUMBSTRIP = 7
FVM_LAST = 7

SHCOLSTATE_TYPE_STR = 1
SHCOLSTATE_TYPE_INT = 2
SHCOLSTATE_TYPE_DATE = 3
SHCOLSTATE_TYPEMASK = $f
SHCOLSTATE_ONBYDEFAULT = $10
SHCOLSTATE_SLOW = $20
SHCOLSTATE_EXTENDED = $40
SHCOLSTATE_SECONDARYUI = $80
SHCOLSTATE_HIDDEN = $100
SHCOLSTATE_PREFER_VARCMP = $200

SHGDN_NORMAL = 0
SHGDN_INFOLDER = 1
SHGDN_FOREDITING = $1000
SHGDN_FORADDRESSBAR = $4000
SHGDN_FORPARSING = $8000

SHCONTF_FOLDERS = $20
SHCONTF_NONFOLDERS = $40
SHCONTF_INCLUDEHIDDEN = $80
SHCONTF_INIT_ON_FIRST_NEXT  = $100
SHCONTF_NETPRINTERSRCH = $200
SHCONTF_SHAREABLE = $400
SHCONTF_STORAGE = $800

SHCIDS_ALLFIELDS = $80000000
SHCIDS_CANONICALONLY = $10000000
SHCIDS_BITMASK = $FFFF0000
SHCIDS_COLUMNMASK = $FFFF
SFGAO_CANCOPY = DROPEFFECT_COPY
SFGAO_CANMOVE = DROPEFFECT_MOVE
SFGAO_CANLINK = DROPEFFECT_LINK
SFGAO_STORAGE = 8
SFGAO_CANRENAME = $10
SFGAO_CANDELETE = $20
SFGAO_HASPROPSHEET = $40
SFGAO_DROPTARGET = $100
SFGAO_CAPABILITYMASK = $177
SFGAO_ENCRYPTED = $2000
SFGAO_ISSLOW = $4000
SFGAO_GHOSTED = $8000
SFGAO_LINK = $10000
SFGAO_SHARE = $20000
SFGAO_READONLY = $40000
SFGAO_HIDDEN = $80000
SFGAO_DISPLAYATTRMASK = $FC000
SFGAO_FILESYSANCESTOR = $10000000
SFGAO_FOLDER = $20000000
SFGAO_FILESYSTEM = $40000000
SFGAO_HASSUBFOLDER = $80000000
SFGAO_CONTENTSMASK = $80000000
SFGAO_VALIDATE = $1000000
SFGAO_REMOVABLE = $2000000
SFGAO_COMPRESSED = $4000000
SFGAO_BROWSABLE = $8000000
SFGAO_NONENUMERATED = $100000
SFGAO_NEWCONTENT = $200000
SFGAO_CANMONIKER = $400000
SFGAO_HASSTORAGE = $400000
SFGAO_STREAM = $400000
SFGAO_STORAGEANCESTOR = $800000
SFGAO_STORAGECAPMASK = $70C50008

STR_SKIP_BINDING_CLSID equ "Skip Binding CLSID"
STR_PARSE_PREFER_FOLDER_BROWSING equ "Parse Prefer Folder Browsing"
STR_DONT_PARSE_RELATIVE equ "Don't Parse Relative"
STR_PARSE_TRANSLATE_ALIASES equ "Parse Translate Aliases"
STR_PARSE_SHELL_PROTOCOL_TO_FILE_OBJECTS equ "Parse Shell Protocol To File Objects"

PID_MISC_STATUS = 2
PID_MISC_ACCESSCOUNT = 3
PID_MISC_OWNER = 4
PID_HTMLINFOTIPFILE = 5
PID_MISC_PICS = 6
PID_SYNC_COPY_IN = 2
PID_DISPLACED_FROM = 2
PID_DISPLACED_DATE = 3
PID_FINDDATA = 0
PID_NETRESOURCE = 1
PID_DESCRIPTIONID = 2
PID_WHICHFOLDER = 3
PID_NETWORKLOCATION = 4
PID_COMPUTERNAME = 5
PID_DISPLAY_PROPERTIES = 0
PID_INTROTEXT = 1
PIDSI_ARTIST = 2
PIDSI_SONGTITLE = 3
PIDSI_ALBUM = 4
PIDSI_YEAR = 5
PIDSI_COMMENT = 6
PIDSI_TRACK = 7
PIDSI_GENRE = 11
PIDSI_LYRICS = 12
PIDDRSI_PROTECTED = 2
PIDDRSI_DESCRIPTION = 3
PIDDRSI_PLAYCOUNT = 4
PIDDRSI_PLAYSTARTS = 5
PIDDRSI_PLAYEXPIRES = 6
PIDVSI_STREAM_NAME = 2
PIDVSI_FRAME_WIDTH = 3
PIDVSI_FRAME_HEIGHT = 4
PIDVSI_TIMELENGTH = 7
PIDVSI_FRAME_COUNT = 5
PIDVSI_FRAME_RATE = 6
PIDVSI_DATA_RATE = 8
PIDVSI_SAMPLE_SIZE = 9
PIDVSI_COMPRESSION = $A
PIDVSI_STREAM_NUMBER = $B
PIDASI_FORMAT = 2
PIDASI_TIMELENGTH = 3
PIDASI_AVG_DATA_RATE = 4
PIDASI_SAMPLE_RATE = 5
PIDASI_SAMPLE_SIZE = 6
PIDASI_CHANNEL_COUNT = 7
PIDASI_STREAM_NUMBER = 8
PIDASI_STREAM_NAME = 9
PIDASI_COMPRESSION = $A
PID_CONTROLPANEL_CATEGORY = 2
PID_VOLUME_FREE = 2
PID_VOLUME_CAPACITY = 3
PID_VOLUME_FILESYSTEM = 4
PID_LINK_TARGET = 2
PID_SHARE_CSC_STATUS = 2
PID_QUERY_RANK = 2

struct SV2CVW2PARAMS
       cbSize dd ?,?
       psvPrev dq ?
       pfs dq ?
       psbOwner dq ?
       prcView dq ?
       pvid dq ?
       hwndView dq ?
ends

struct SHITEMID
       cb dw ?
       abID db ?
ends

struct ITEMIDLIST
       mkid SHITEMID
ends

STRRET_WSTR = 0
STRRET_OFFSET = 1
STRRET_CSTR = 0

struct STRRET
       uType dd ?,?
       union
	   pOleStr dq ?
	   uOffset dd ?
	   cStr    db MAX_PATH dup(?)
       ends
       dd ?
ends

struct SHELLDETAILS
       fmt dd ?
       cxChar dd ?
       str STRRET
ends

;File: shlobj.h
CMF_NORMAL = 0
CMF_DEFAULTONLY = 1
CMF_VERBSONLY = 2
CMF_EXPLORE = 4
CMF_NOVERBS = 8
CMF_CANRENAME = $10
CMF_NODEFAULT = $20
CMF_INCLUDESTATIC = $40
CMF_EXTENDEDVERBS = $100
CMF_RESERVED = $ffff0000

GCS_VERBA = 0
GCS_HELPTEXTA = 1
GCS_VALIDATEA = 2
GCS_VERBW = 4
GCS_HELPTEXTW = 5
GCS_VALIDATEW = 6
GCS_UNICODE = 4

GCS_VERB = GCS_VERBA
GCS_HELPTEXT = GCS_HELPTEXTA
GCS_VALIDATE = GCS_VALIDATEA

CMDSTR_NEWFOLDERA equ "NewFolder"
CMDSTR_VIEWLISTA equ "ViewList"
CMDSTR_VIEWDETAILSA equ "ViewDetails"
CMDSTR_NEWFOLDERW equ "NewFolder"
CMDSTR_VIEWLISTW equ "ViewList"
CMDSTR_VIEWDETAILSW equ "ViewDetails"

CMIC_MASK_HOTKEY = SEE_MASK_HOTKEY
CMIC_MASK_ICON = SEE_MASK_ICON
CMIC_MASK_FLAG_NO_UI = SEE_MASK_FLAG_NO_UI
CMIC_MASK_UNICODE = SEE_MASK_UNICODE
CMIC_MASK_NO_CONSOLE = SEE_MASK_NO_CONSOLE
;CMIC_MASK_HASLINKNAME = SEE_MASK_HASLINKNAME
;CMIC_MASK_FLAG_SEP_VDM = SEE_MASK_FLAG_SEPVDM
;CMIC_MASK_HASTITLE = SEE_MASK_HASTITLE
CMIC_MASK_ASYNCOK = SEE_MASK_ASYNCOK
CMIC_MASK_NOZONECHECKS = SEE_MASK_NOZONECHECKS
CMIC_MASK_SHIFT_DOWN = $10000000
CMIC_MASK_CONTROL_DOWN = $40000000
CMIC_MASK_FLAG_LOG_USAGE = SEE_MASK_FLAG_LOG_USAGE
CMIC_MASK_NOZONECHECKS = SEE_MASK_NOZONECHECKS
CMIC_MASK_PTINVOKE = $20000000

struct CMINVOKECOMMANDINFO
       cbSize dd ?
       fMask dd ?
       hwnd dq ?
       lpVerb dq ?
       lpParameters dq ?
       lpDirectory dq ?
       nShow dd ?
       dwHotKey dd ?
       hIcon dq ?
ends

struct CMINVOKECOMMANDINFOEX
       cbSize dd ?
       fMask dd ?
       hwnd dq ?
       lpVerb dq ?
       lpParameters dq ?
       lpDirectory dq ?
       nShow dd ?
       dwHotKey dd ?
       hIcon dq ?
       lpTitle dq ?
       lpVerbW dq ?
       lpParametersW dq ?
       lpDirectoryW dq ?
       lpTitleW dq ?
       ptInvoke POINT
ends

interface IContextMenu,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  QueryContextMenu,\
	  InvokeCommand,\
	  GetCommandString

interface IContextMenu2,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  QueryContextMenu,\
	  InvokeCommand,\
	  GetCommandString,\
	  HandleMenuMsg

interface IContextMenu3,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  QueryContextMenu,\
	  InvokeCommand,\
	  GetCommandString,\
	  HandleMenuMsg,\
	  HandleMenuMsg2

CSIDL_FLAG_PFTI_TRACKTARGET = CSIDL_FLAG_DONT_VERIFY

struct PERSISTFOLDERTARGETINFO
       pidlTargetFolder dq ?
       szTargetParsingName du MAX_PATH dup(?)
       szNetworkProvider du MAX_PATH dup(?)
       dwAttributes dd ?
       csidl dd ?
ends

interface IPersistFolder3,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetClassID,\
	  Initialize,\
	  GetCurFolder,\
	  InitializeEx,\
	  GetFolderTargetInfo

GIL_OPENICON = 1
GIL_FORSHELL = 2
GIL_ASYNC = $20
GIL_DEFAULTICON = $40
GIL_FORSHORTCUT = $80

GIL_SIMULATEDOC = 1
GIL_PERINSTANCE = 2
GIL_PERCLASS = 4
GIL_NOTFILENAME = 8
GIL_DONTCACHE = $10

interface IExtractIconA,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetIconLocation,\
	  Extract

interface IExtractIconW,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetIconLocation,\
	  Extract

interface IShellIcon,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetIconOf

interface IShellIconOverlayIdentifier,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  IsMemberOf,\
	  GetOverlayInfo,\
	  GetPriority

ISIOI_ICONFILE = 1
ISIOI_ICONINDEX = 2

interface IShellIconOverlayManager,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetFileOverlayInfo,\
	  GetReservedOverlayInfo,\
	  RefreshOverlayImages,\
	  LoadNonloadedOverlayIdentifiers,\
	  OverlayIndexFromImageIndex

SIOM_OVERLAYINDEX = 1
SIOM_ICONINDEX = 2
SIOM_RESERVED_SHARED = 0
SIOM_RESERVED_LINK = 1
SIOM_RESERVED_SLOWFILE = 2

interface IShellIconOverlay,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetOverlayIndex,\
	  GetOverlayIconIndex

OI_ASYNC = $FFFFEEEE
IDO_SHGIOI_SHARE = $FFFFFFF
IDO_SHGIOI_LINK = $FFFFFFE
IDO_SHGIOI_SLOWFILE = $FFFFFFFD

SLDF_HAS_ID_LIST = 1
SLDF_HAS_LINK_INFO = 2
SLDF_HAS_NAME = 4
SLDF_HAS_RELPATH = 8
SLDF_HAS_WORKINGDIR = $10
SLDF_HAS_ARGS = $20
SLDF_HAS_ICONLOCATION = $40
SLDF_UNICODE = $80
SLDF_FORCE_NO_LINKINFO = $100
SLDF_HAS_EXP_SZ = $200
SLDF_RUN_IN_SEPARATE = $400
SLDF_HAS_LOGO3ID = $800
SLDF_HAS_DARWINID = $1000
SLDF_RUNAS_USER = $2000
SLDF_HAS_EXP_ICON_SZ = $4000
SLDF_NO_PIDL_ALIAS = $8000
SLDF_FORCE_UNCNAME = $10000
SLDF_RUN_WITH_SHIMLAYER = $20000
SLDF_RESERVED = $80000000

struct DATABLOCKHEADER
       cbSize dd ?
       dwSignature dd ?
ends

struct NTCONSOLEPROPS
       dbh DATABLOCKHEADER
       wFillAttribute dw ?
       wPopupFillAttribute dw ?
       dwScreenBufferSize dd ?
       dwWindowSize dd ?
       dwWindowOrigin dd ?
       nFont dd ?
       nInputBufferSize dd ?
       dwFontSize dd ?
       uFontFamily dd ?
       uFontWeight dd ?
       FaceName du LF_FACESIZE dup(?)
       uCursorSize dd ?
       bFullScreen dd ?
       bQuickEdit dd ?
       bInsertMode dd ?
       bAutoPosition dd ?
       uHistoryBufferSize dd ?
       uNumberOfHistoryBuffers dd ?
       bHistoryNoDup dd ?
       ColorTable dd 16 dup(?)
ends

NT_CONSOLE_PROPS_SIG = $A0000002

struct NTFECONSOLEPROPS
       dbh DATABLOCKHEADER
       uCodePage dd ?
ends

NT_FE_CONSOLE_PROPS_SIG = $A0000004

struct EXPDARWINLINK
       dbh DATABLOCKHEADER
       szDarwinID db MAX_PATH dup(?)
       szwDarwinID du MAX_PATH dup(?)
ends

EXP_DARWIN_ID_SIG = $A0000006
EXP_LOGO3_ID_SIG = $A0000007

EXP_SPECIAL_FOLDER_SIG = $A0000005

struct EXPSPECIALFOLDER
       cbSize dd ?
       dwSignature dd ?
       idSpecialFolder dd ?
       cbOffset dd ?
ends

struct EXPSZLINK
       cbSize dd ?
       dwSignature dd ?
       szTarget db MAX_PATH dup(?)
       swzTarget du MAX_PATH dup(?)
ends

EXP_SZ_LINK_SIG = $A0000001
EXP_SZ_ICON_SIG = $A0000007

interface IShellLinkDataList,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  AddDataBlock,\
	  CopyDataBlock,\
	  RemoveDataBlock,\
	  GetFlags,\
	  SetFlags

interface IResolveShellLink,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  ResolveShellLink

interface IShellExecuteHookA,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Execute

interface IShellExecuteHookW,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Execute

interface IURLSearchHook,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Translate

interface ISearchContext,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetSearchUrl,\
	  GetSearchText,\
	  GetSearchStyle

interface IURLSearchHook2,\
	  TranslateWithSearchContext

interface INewShortcutHookA,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetReferent,\
	  GetReferent,\
	  SetFolder,\
	  GetFolder,\
	  GetName,\
	  GetExtension

interface INewShortcutHookW,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetReferent,\
	  GetReferent,\
	  SetFolder,\
	  GetFolder,\
	  GetName,\
	  GetExtension

FO_MOVE = 1
FO_COPY = 2
FO_DELETE = 3
FO_RENAME = 4

FOF_MULTIDESTFILES = 1
FOF_CONFIRMMOUSE = 2
FOF_SILENT = 4
FOF_RENAMEONCOLLISION = 8
FOF_NOCONFIRMATION = $10
FOF_WANTMAPPINGHANDLE = $20
FOF_ALLOWUNDO = $40
FOF_FILESONLY = $80
FOF_SIMPLEPROGRESS = $100
FOF_NOCONFIRMMKDIR = $200
FOF_NOERRORUI = $400
FOF_NOCOPYSECURITYATTRIBS = $800
FOF_NORECURSION = $1000
FOF_NO_CONNECTED_ELEMENTS = $2000
FOF_WANTNUKEWARNING = $4000
FOF_NORECURSEREPARSE = $8000

PO_DELETE = $13
PO_RENAME = $14
PO_PORTCHANGE = $20
PO_REN_PORT = $34

interface ICopyHookA,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  CopyCallback

interface ICopyHookW,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  CopyCallback

interface IFileViewerSite,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetPinnedWindow,\
	  GetPinnedWindow

struct FVSHOWINFO
       cbSize dd ?
       hwndOwner dd ?
       iShow dd ?
       dwFlags dd ?
       rect RECT
       punkRel dd ?
       strNewFile dw MAX_PATH
ends

FVSIF_RECT = 1
FVSIF_PINNED = 2
FVSIF_NEWFAILED = $8000000
FVSIF_NEWFILE = $80000000
FVSIF_CANVIEWIT = $40000000

interface IFileViewerA,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  ShowInitialize,\
	  Show,\
	  PrintTo

interface IFileViewerW,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  ShowInitialize,\
	  Show,\
	  PrintTo

FCIDM_SHVIEWFIRST = 0
FCIDM_SHVIEWLAST = $7fff
FCIDM_BROWSERFIRST = $a000
FCIDM_BROWSERLAST = $bf00
FCIDM_GLOBALFIRST = $8000
FCIDM_GLOBALLAST = $9fff
FCIDM_MENU_FILE = FCIDM_GLOBALFIRST + $0
FCIDM_MENU_EDIT = FCIDM_GLOBALFIRST + $40
FCIDM_MENU_VIEW = FCIDM_GLOBALFIRST + $80
FCIDM_MENU_VIEW_SEP_OPTIONS = FCIDM_GLOBALFIRST + $81
FCIDM_MENU_TOOLS = FCIDM_GLOBALFIRST + $c0
FCIDM_MENU_TOOLS_SEP_GOTO = FCIDM_GLOBALFIRST + $c1
FCIDM_MENU_HELP = FCIDM_GLOBALFIRST + $100
FCIDM_MENU_FIND = FCIDM_GLOBALFIRST + $140
FCIDM_MENU_EXPLORE = FCIDM_GLOBALFIRST + $150
FCIDM_MENU_FAVORITES = FCIDM_GLOBALFIRST + $170
FCIDM_TOOLBAR = FCIDM_BROWSERFIRST + 0
FCIDM_STATUS = FCIDM_BROWSERFIRST + 1

IDC_OFFLINE_HAND = 103

PANE_NONE = -1
PANE_ZONE = 1
PANE_OFFLINE = 2
PANE_PRINTER = 3
PANE_SSL = 4
PANE_NAVIGATION = 5
PANE_PROGRESS = 6
PANE_PRIVACY = 7

CDBOSC_SETFOCUS = 0
CDBOSC_KILLFOCUS = 1
CDBOSC_SELCHANGE = 2
CDBOSC_RENAME = 3
CDBOSC_STATECHANGE = 4

interface ICommDlgBrowser,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  OnDefaultCommand,\
	  OnStateChange,\
	  IncludeObject

CDB2N_CONTEXTMENU_DONE = 1
CDB2N_CONTEXTMENU_START = 2
CDB2GVF_SHOWALLFILES = 1

interface ICommDlgBrowser2,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  OnDefaultCommand,\
	  OnStateChange,\
	  IncludeObject,\
	  Notify,\
	  GetDefaultMenuText,\
	  GetViewFlags

REGSTR_PATH_SPECIAL_FOLDERS equ "\\Shell Folders"
REGSTR_PATH_EXPLORER equ "\\Shell Folders"

CSIDL_DESKTOP = 0
CSIDL_INTERNET = 1
CSIDL_PROGRAMS = 2
CSIDL_CONTROLS = 3
CSIDL_PRINTERS = 4
CSIDL_PERSONAL = 5
CSIDL_FAVORITES = 6
CSIDL_STARTUP = 7
CSIDL_RECENT = 8
CSIDL_SENDTO = 9
CSIDL_BITBUCKET = $a
CSIDL_STARTMENU = $b
CSIDL_MYDOCUMENTS = $c
CSIDL_MYMUSIC = $d
CSIDL_MYVIDEO = $e
CSIDL_DESKTOPDIRECTORY = $10
CSIDL_DRIVES = $11
CSIDL_NETWORK = $12
CSIDL_NETHOOD = $13
CSIDL_FONTS = $14
CSIDL_TEMPLATES = $15
CSIDL_COMMON_STARTMENU = $16
CSIDL_COMMON_PROGRAMS = $17
CSIDL_COMMON_STARTUP = $18
CSIDL_COMMON_DESKTOPDIRECTORY = $19
CSIDL_APPDATA = $1a
CSIDL_PRINTHOOD = $1b
CSIDL_LOCAL_APPDATA = $1c
CSIDL_ALTSTARTUP = $1d
CSIDL_COMMON_ALTSTARTUP = $1e
CSIDL_COMMON_FAVORITES = $1f
CSIDL_INTERNET_CACHE = $20
CSIDL_COOKIES = $21
CSIDL_HISTORY = $22
CSIDL_COMMON_APPDATA = $23
CSIDL_WINDOWS = $24
CSIDL_SYSTEM = $25
CSIDL_PROGRAM_FILES  = $26
CSIDL_MYPICTURES = $27
CSIDL_PROFILE = $28
CSIDL_SYSTEMX86 = $29
CSIDL_PROGRAM_FILESX86 = $2a
CSIDL_PROGRAM_FILES_COMMON = $2b
CSIDL_PROGRAM_FILES_COMMONX86 = $2c
CSIDL_COMMON_TEMPLATES = $2d
CSIDL_COMMON_DOCUMENTS = $2e
CSIDL_COMMON_ADMINTOOLS = $2f
CSIDL_ADMINTOOLS = $30
CSIDL_CONNECTIONS = $31
CSIDL_COMMON_MUSIC = $35
CSIDL_COMMON_PICTURES = $36
CSIDL_COMMON_VIDEO = $37
CSIDL_RESOURCES = $38
CSIDL_RESOURCES_LOCALIZED = $39
CSIDL_COMMON_OEM_LINKS = $3a
CSIDL_CDBURN_AREA = $3b
CSIDL_COMPUTERSNEARME = $3d
CSIDL_FLAG_CREATE = $8000
CSIDL_FLAG_DONT_VERIFY = $4000
CSIDL_FLAG_NO_ALIAS = $1000
CSIDL_FLAG_PER_USER_INIT = $800
CSIDL_FLAG_MASK = $FF00

SHGFP_TYPE_CURRENT = 0
SHGFP_TYPE_DEFAULT = 1

FCS_READ = 1
FCS_FORCEWRITE = 2
FCS_WRITE = (FCS_READ or FCS_FORCEWRITE)
FCS_FLAG_DRAGDROP = 2
FCSM_VIEWID = 1
FCSM_WEBVIEWTEMPLATE = 2
FCSM_INFOTIP = 4
FCSM_CLSID = 8
FCSM_ICONFILE = $10
FCSM_LOGO = $20
FCSM_FLAGS = $40

struct SHFOLDERCUSTOMSETTINGSA
       dwSize dd ?
       dwMask dd ?
       pvid dq ?
       pszWebViewTemplate dq ?
       cchWebViewTemplate dd ?,?
       pszWebViewTemplateVersion dq ?
       pszInfoTip dq ?
       cchInfoTip dd ?,?
       pclsid dq ?
       dwFlags dd ?,?
       pszIconFile dq ?
       cchIconFile dd ?
       iIconIndex dd ?
       pszLogo dq ?
       cchLogo dd ?,?
ends

struct SHFOLDERCUSTOMSETTINGSW
       dwSize dd ?
       dwMask dd ?
       pvid dq ?
       pszWebViewTemplate dq ?
       cchWebViewTemplate dd ?,?
       pszWebViewTemplateVersion dq ?
       pszInfoTip dq ?
       cchInfoTip dd ?,?
       pclsid dq ?
       dwFlags dd ?,?
       pszIconFile dq ?
       cchIconFile dd ?
       iIconIndex dd ?
       pszLogo dq ?
       cchLogo dd ?,?
ends

struct BROWSEINFOA
       hwndOwner dq ?
       pidlRoot dq ?
       pszDisplayName dq ?
       lpszTitle dq ?
       ulFlags dd ?,?
       lpfn dq ?
       lParam dq ?
       iImage dd ?,?
ends

struct BROWSEINFOW
       hwndOwner dq ?
       pidlRoot dq ?
       pszDisplayName dq ?
       lpszTitle dq ?
       ulFlags dd ?,?
       lpfn dq ?
       lParam dq ?
       iImage dd ?,?
ends

BIF_RETURNONLYFSDIRS = 1
BIF_DONTGOBELOWDOMAIN = 2
BIF_STATUSTEXT = 4
BIF_RETURNFSANCESTORS = 8
BIF_EDITBOX = $10
BIF_VALIDATE = $20
BIF_NEWDIALOGSTYLE = $40
BIF_USENEWUI = (BIF_NEWDIALOGSTYLE or BIF_EDITBOX)
BIF_BROWSEINCLUDEURLS = $80
BIF_UAHINT = $100
BIF_NONEWFOLDERBUTTON = $200
BIF_NOTRANSLATETARGETS = $400
BIF_BROWSEFORCOMPUTER = $1000
BIF_BROWSEFORPRINTER = $2000
BIF_BROWSEINCLUDEFILES = $4000
BIF_SHAREABLE = $8000
BFFM_INITIALIZED = 1
BFFM_SELCHANGED = 2
BFFM_VALIDATEFAILEDA = 3
BFFM_VALIDATEFAILEDW = 4
BFFM_IUNKNOWN = 5
BFFM_SETSTATUSTEXTA = (WM_USER + 100)
BFFM_ENABLEOK = (WM_USER + 101)
BFFM_SETSELECTIONA = (WM_USER + 102)
BFFM_SETSELECTIONW = (WM_USER + 103)
BFFM_SETSTATUSTEXTW = (WM_USER + 104)
BFFM_SETOKTEXT = (WM_USER + 105)
BFFM_SETEXPANDED = (WM_USER + 106)

ISHCUTCMDID_DOWNLOADICON = 0
ISHCUTCMDID_INTSHORTCUTCREATE = 1
CMDID_INTSHORTCUTCREATE = ISHCUTCMDID_INTSHORTCUTCREATE

STR_FILE_SYS_BIND_DATA equ "File System Bind Data"

interface IFileSystemBindData,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetFindData,\
	  GetFindData

interface IShellDetails,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetDetailsOf,\
	  ColumnClick

interface IObjMgr,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Append,\
	  Remove

interface ICurrentWorkingDirectory,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetDirectory,\
	  SetDirectory

interface IACList,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Expand

ACLO_NONE = 0
ACLO_CURRENTDIR = 1
ACLO_MYCOMPUTER = 2
ACLO_DESKTOP = 4
ACLO_FAVORITES = 8
ACLO_FILESYSONLY = 16
ACLO_FILESYSDIRS = 32

interface IACList2,\
	  SetOptions,\
	  GetOptions

PROGDLG_NORMAL = 0
PROGDLG_MODAL = 1
PROGDLG_AUTOTIME = 2
PROGDLG_NOTIME = 4
PROGDLG_NOMINIMIZE = 8
PROGDLG_NOPROGRESSBAR = $10

PDTIMER_RESET = 1

interface IProgressDialog,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  StartProgressDialog,\
	  StopProgressDialog,\
	  SetTitle,\
	  SetAnimation,\
	  HasUserCancelled,\
	  SetProgress,\
	  SetProgress64,\
	  SetLine,\
	  SetCancelMsg,\
	  Timer

interface IInputObjectSite,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  OnFocusChangeIS

interface IInputObject,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  UIActivateIO,\
	  HasFocusIO,\
	  TranslateAcceleratorIO

interface IDockingWindowSite,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetWindow,\
	  ContextSensitiveHelp,\
	  GetBorderDW,\
	  RequestBorderSpaceDW,\
	  SetBorderSpaceDW

DWFRF_NORMAL = 0
DWFRF_DELETECONFIGDATA	= 1
DWFAF_HIDDEN = 1

interface IDockingWindowFrame,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetWindow,\
	  ContextSensitiveHelp,\
	  AddToolbar,\
	  RemoveToolbar,\
	  FindToolbar

IRTIR_TASK_NOT_RUNNING = 0
IRTIR_TASK_RUNNING = 1
IRTIR_TASK_SUSPENDED = 2
IRTIR_TASK_PENDING = 3
IRTIR_TASK_FINISHED = 4

interface IRunnableTask,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Run,\
	  Kill,\
	  Suspend,\
	  Resume,\
	  IsRunning

ITSSFLAG_COMPLETE_ON_DESTROY = 0
ITSSFLAG_KILL_ON_DESTROY = 1
ITSSFLAG_SUPPORTS_TERMINATE = 2
ITSSFLAG_FLAGS_MASK = 3
ITSSFLAG_THREAD_TERMINATE_TIMEOUT = $10
ITSSFLAG_THREAD_POOL_TIMEOUT = $20
ITSS_THREAD_DESTROY_DEFAULT_TIMEOUT = (60*1000)
ITSS_THREAD_TERMINATE_TIMEOUT = (INFINITE)
ITSS_THREAD_TIMEOUT_NO_CHANGE = (INFINITE - 1)
ITSAT_DEFAULT_LPARAM = $ffffffff
ITSAT_DEFAULT_PRIORITY = $10000000
ITSAT_MAX_PRIORITY = $7fffffff
ITSAT_MIN_PRIORITY = 0

interface IShellTaskScheduler,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  AddTask,\
	  RemoveTasks,\
	  CountTasks,\
	  Status

ITSSFLAG_TASK_PLACEINFRONT = 1
ITSSFLAG_TASK_PLACEINBACK = 2

interface IShellTaskScheduler2,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  AddTask,\
	  RemoveTasks,\
	  CountTasks,\
	  Status,\
	  AddTask2,\
	  MoveTask

interface IThumbnailCapture,\
	  CaptureThumbnai

struct ENUMIMAGESTOREDATATAG
       szPath du MAX_PATH dup(?)
       ftTimeStamp FILETIME
ends

interface IEnumShellImageStore,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Reset,\
	  Next,\
	  Skip,\
	  Clone

SHIMSTCAPFLAG_LOCKABLE = 1
SHIMSTCAPFLAG_PURGEABLE = 2

interface IShellImageStore,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Open,\
	  Create,\
	  ReleaseLock,\
	  Close,\
	  Commit,\
	  IsLocked,\
	  GetMode,\
	  GetCapabilities,\
	  AddEntry,\
	  GetEntry,\
	  DeleteEntry,\
	  IsEntryInStore,\
	  Enum

ISFB_MASK_STATE = 1
ISFB_MASK_BKCOLOR = 2
ISFB_MASK_VIEWMODE = 4
ISFB_MASK_SHELLFOLDER = 8
ISFB_MASK_IDLIST = $10
ISFB_MASK_COLORS = $20

ISFB_STATE_DEFAULT = 0
ISFB_STATE_DEBOSSED = 1
ISFB_STATE_ALLOWRENAME = 2
ISFB_STATE_NOSHOWTEXT = 4
ISFB_STATE_CHANNELBAR = $10
ISFB_STATE_QLINKSMODE = $20
ISFB_STATE_FULLOPEN = $40
ISFB_STATE_NONAMESORT = $80
ISFB_STATE_BTNMINSIZE = $100

ISFBVIEWMODE_SMALLICONS = 1
ISFBVIEWMODE_LARGEICONS = 2
ISFBVIEWMODE_LOGOS = 3

struct BANDINFOSF
       dwMask dd ?
       dwStateMask dd ?
       dwState dd ?
       crBkgnd dd ?
       crBtnLt dd ?
       crBtnDk dd ?
       wViewMode dw ?
       wAlign dw ?
       psf dq ?
       pidl dq ?
       dd ?
ends

interface IShellFolderBand,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  InitializeSFB,\
	  SetBandInfoSFB,\
	  GetBandInfoSFB

SFBID_PIDLCHANGED = 0

interface IDeskBarClient,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetWindow,\
	  ContextSensitiveHelp,\
	  SetDeskBarSite,\
	  SetModeDBC,\
	  UIActivateDBC,\
	  GetSize

DBC_GS_IDEAL = 0
DBC_GS_SIZEDOWN = 1
DBC_HIDE = 0
DBC_SHOW = 1
DBC_SHOWOBSCURE = 2

DBCID_EMPTY = 0
DBCID_ONDRAG = 1
DBCID_CLSIDOFBAR = 2
DBCID_RESIZE = 3
DBCID_GETBAR = 4

struct WALLPAPEROPT
       dwSize dd ?
       dwStyle dd ?
ends

struct COMPONENTSOPT
       dwSize dd ?
       fEnableComponents dd ?
       fActiveDesktop dd ?
ends

struct COMPPOS
       dwSize dd ?
       iLeft dd ?
       iTop dd ?
       dwWidth dd ?
       dwHeight dd ?
       izIndex dd ?
       fCanResize dd ?
       fCanResizeX dd ?
       fCanResizeY dd ?
       iPreferredLeftPercent dd ?
       iPreferredTopPercent dd ?
ends

struct COMPSTATEINFO
       dwSize dd ?
       iLeft dd ?
       iTop dd ?
       dwWidth dd ?
       dwHeight dd ?
       dwItemState dd ?
ends

COMPONENT_TOP = $3fffffff

COMP_TYPE_HTMLDOC = 0
COMP_TYPE_PICTURE = 1
COMP_TYPE_WEBSITE = 2
COMP_TYPE_CONTROL = 3
COMP_TYPE_CFHTML = 4
COMP_TYPE_MAX = 4

struct IE4COMPONENT
       dwSize dd ?
       dwID dd ?
       iComponentType dd ?
       fChecked dd ?
       fDirty dd ?
       fNoScroll dd ?
       cpPos COMPPOS
       wszFriendlyName du MAX_PATH dup(?)
       wszSource du INTERNET_MAX_URL_LENGTH dup(?)
       wszSubscribedURL du INTERNET_MAX_URL_LENGTH dup(?)
ends

struct COMPONENT
       dwSize dd ?
       dwID dd ?
       iComponentType dd ?
       fChecked dd ?
       fDirty dd ?
       fNoScroll dd ?
       cpPos COMPPOS
       wszFriendlyName du MAX_PATH dup(?)
       wszSource du INTERNET_MAX_URL_LENGTH dup(?)
       wszSubscribedURL du INTERNET_MAX_URL_LENGTH dup(?)
       dwCurItemState dd ?
       csiOriginal COMPSTATEINFO
       csiRestored COMPSTATEINFO
ends

IS_NORMAL = 1
IS_FULLSCREEN = 2
IS_SPLIT = 4
IS_VALIDSIZESTATEBITS = (IS_NORMAL or IS_SPLIT or IS_FULLSCREEN)
IS_VALIDSTATEBITS = (IS_NORMAL or IS_SPLIT or IS_FULLSCREEN or $80000000 or $40000000)

AD_APPLY_SAVE = 1
AD_APPLY_HTMLGEN = 2
AD_APPLY_REFRESH = 4
AD_APPLY_ALL = (AD_APPLY_SAVE or AD_APPLY_HTMLGEN or AD_APPLY_REFRESH)
AD_APPLY_FORCE = 8
AD_APPLY_BUFFERED_REFRESH = $10
AD_APPLY_DYNAMICREFRESH = $20

WPSTYLE_CENTER = 0
WPSTYLE_TILE = 1
WPSTYLE_STRETCH = 2
WPSTYLE_MAX = 3

COMP_ELEM_TYPE = 1
COMP_ELEM_CHECKED = 2
COMP_ELEM_DIRTY = 4
COMP_ELEM_NOSCROLL = 8
COMP_ELEM_POS_LEFT = $10
COMP_ELEM_POS_TOP = $20
COMP_ELEM_SIZE_WIDTH = $40
COMP_ELEM_SIZE_HEIGHT = $80
COMP_ELEM_POS_ZINDEX = $100
COMP_ELEM_SOURCE = $200
COMP_ELEM_FRIENDLYNAME = $400
COMP_ELEM_SUBSCRIBEDURL = $800
COMP_ELEM_ORIGINAL_CSI = $1000
COMP_ELEM_RESTORED_CSI = $2000
COMP_ELEM_CURITEMSTATE = $4000

COMP_ELEM_ALL = (COMP_ELEM_TYPE or COMP_ELEM_CHECKED or COMP_ELEM_DIRTY or \
		COMP_ELEM_NOSCROLL or COMP_ELEM_POS_LEFT or COMP_ELEM_SIZE_WIDTH  or \
		COMP_ELEM_SIZE_HEIGHT or COMP_ELEM_POS_ZINDEX or COMP_ELEM_SOURCE or \
		COMP_ELEM_FRIENDLYNAME or COMP_ELEM_POS_TOP or COMP_ELEM_SUBSCRIBEDURL or \
		COMP_ELEM_ORIGINAL_CSI or COMP_ELEM_RESTORED_CSI or COMP_ELEM_CURITEMSTATE)

DTI_ADDUI_DEFAULT = 0
DTI_ADDUI_DISPSUBWIZARD = 1
DTI_ADDUI_POSITIONITEM = 2

ADDURL_SILENT = 1

COMPONENT_DEFAULT_LEFT = $FFFF
COMPONENT_DEFAULT_TOP = $FFFF

interface IActiveDesktop,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  ApplyChanges,\
	  GetWallpaper,\
	  SetWallpaper,\
	  GetWallpaperOptions,\
	  SetWallpaperOptions,\
	  GetPattern,\
	  SetPattern,\
	  GetDesktopItemOptions,\
	  SetDesktopItemOptions,\
	  AddDesktopItem,\
	  AddDesktopItemWithUI,\
	  ModifyDesktopItem,\
	  RemoveDesktopItem,\
	  GetDesktopItemCount,\
	  GetDesktopItem,\
	  GetDesktopItemByID,\
	  GenerateDesktopItemHtml,\
	  AddUrl,\
	  GetDesktopItemBySource

SSM_CLEAR = 0
SSM_SET = 1
SSM_REFRESH = 2
SSM_UPDATE = 4

SCHEME_DISPLAY = 1
SCHEME_EDIT = 2
SCHEME_LOCAL = 4
SCHEME_GLOBAL = 8
SCHEME_REFRESH = $10
SCHEME_UPDATE = $20
SCHEME_DONOTUSE = $40
SCHEME_CREATE = $80

interface IActiveDesktopP,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetSafeMode,\
	  EnsureUpdateHTML,\
	  SetScheme,\
	  GetScheme

GADOF_DIRTY = 1

interface IADesktopP2,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  ReReadWallpaper,\
	  GetADObjectFlags,\
	  UpdateAllDesktopSubscriptions,\
	  MakeDynamicChanges

MAX_COLUMN_NAME_LEN = 80
MAX_COLUMN_DESC_LEN = 128

struct SHCOLUMNINFO
       scid GUID
       dd ?
       vt dw ?
       fmt dd ?
       cChars dd ?
       csFlags dd ?
       wszTitle du MAX_COLUMN_NAME_LEN dup(?)
       wszDescription du MAX_COLUMN_DESC_LEN dup(?)
ends

struct SHCOLUMNINIT
       dwFlags dd ?
       dwReserved dd ?
       wszFolder du MAX_PATH dup(?)
ends

SHCDF_UPDATEITEM = 1

struct SHCOLUMNDATA
       dwFlags dd ?
       dwFileAttributes dd ?
       dwReserved dd ?,?
       pwszExt dq ?
       wszFile du MAX_PATH dup(?)
ends

interface IColumnProvider,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Initialize,\
	  GetColumnInfo,\
	  GetItemData

struct SHDRAGIMAGE
       sizeDragImage SIZE
       ptOffset POINT
       hbmpDragImage dq ?
       crColorKey dd ?,?
ends

DI_GETDRAGIMAGE equ "ShellGetDragImage"

interface IDropTargetHelper,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  DragEnter,\
	  DragLeave,\
	  DragOver,\
	  Drop,\
	  Show

interface IDragSourceHelper,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  InitializeFromBitmap,\
	  InitializeFromWindow

CFSTR_SHELLIDLIST equ "Shell IDList Array"
CFSTR_SHELLIDLISTOFFSET equ "Shell Object Offsets"
CFSTR_NETRESOURCES equ "Net Resource"
CFSTR_FILEDESCRIPTORA equ "FileGroupDescriptor"
CFSTR_FILEDESCRIPTORW equ "FileGroupDescriptorW"
CFSTR_FILECONTENTS equ "FileContents"
CFSTR_FILENAMEA equ "FileName"
CFSTR_FILENAMEW equ "FileNameW"
CFSTR_PRINTERGROUP equ "PrinterFriendlyName"
CFSTR_FILENAMEMAPA equ "FileNameMap"
CFSTR_FILENAMEMAPW equ "FileNameMapW"
CFSTR_SHELLURL equ "UniformResourceLocator"
CFSTR_INETURLA equ CFSTR_SHELLURL
CFSTR_INETURLW equ "UniformResourceLocatorW"
CFSTR_PREFERREDDROPEFFECT equ "Preferred DropEffect"
CFSTR_PERFORMEDDROPEFFECT equ "Performed DropEffect"
CFSTR_PASTESUCCEEDED equ "Paste Succeeded"
CFSTR_INDRAGLOOP equ "InShellDragLoop"
CFSTR_DRAGCONTEXT equ "DragContext"
CFSTR_MOUNTEDVOLUME equ "MountedVolume"
CFSTR_PERSISTEDDATAOBJECT equ "PersistedDataObject"
CFSTR_TARGETCLSID equ "TargetCLSID"
CFSTR_LOGICALPERFORMEDDROPEFFECT equ "Logical Performed DropEffect"
CFSTR_AUTOPLAY_SHELLIDLISTS equ "Autoplay Enumerated IDList Array"
CFSTR_UNTRUSTEDDRAGDROP equ "UntrustedDragDrop"

CFSTR_FILEDESCRIPTOR equ CFSTR_FILEDESCRIPTORA
CFSTR_FILENAME equ CFSTR_FILENAMEA
CFSTR_FILENAMEMAP equ CFSTR_FILENAMEMAPA
CFSTR_INETURL equ CFSTR_INETURLA

DVASPECT_SHORTNAME = 2
DVASPECT_COPY = 3
DVASPECT_LINK = 4

struct NRESARRAY
       cItems dd ?
       nr NETRESOURCEA
ends

struct IDA
       cidl dd ?
       aoffset dd ?
ends

FD_CLSID = 1
FD_SIZEPOINT = 2
FD_ATTRIBUTES = 4
FD_CREATETIME = 8
FD_ACCESSTIME = $10
FD_WRITESTIME = $20
FD_FILESIZE = $40
FD_PROGRESSUI = $4000
FD_LINKUI = $8000

struct FILEDESCRIPTORA
       dwFlags dd ?
       clsid GUID
       sizel SIZEL
       pointl POINTL
       dwFileAttributes dd ?
       ftCreationTime FILETIME
       ftLastAccessTime FILETIME
       ftLastWriteTime FILETIME
       nFileSizeHigh dd ?
       nFileSizeLow dd ?
       cFileName db MAX_PATH dup(?)
ends

struct FILEDESCRIPTORW
       dwFlags dd ?
       clsid GUID
       sizel SIZEL
       pointl POINTL
       dwFileAttributes dd ?
       ftCreationTime FILETIME
       ftLastAccessTime FILETIME
       ftLastWriteTime FILETIME
       nFileSizeHigh dd ?
       nFileSizeLow dd ?
       cFileName du MAX_PATH dup(?)
ends

struct FILEGROUPDESCRIPTORA
       cItems dd ?
       fgd FILEDESCRIPTORA
ends

struct FILEGROUPDESCRIPTORW
       cItems dd ?
       fgd FILEDESCRIPTORW
ends

struct DROPFILES
       pFiles dd ?
       pt POINT
       fNC dd ?
       fWide dd ?
ends

struct SHCHANGENOTIFYENTRY
       pidl dq ?
       fRecursive dd ?
ends

SHCNE_RENAMEITEM = 1
SHCNE_CREATE = 2
SHCNE_DELETE = 4
SHCNE_MKDIR = 8
SHCNE_RMDIR = $10
SHCNE_MEDIAINSERTED = $20
SHCNE_MEDIAREMOVED = $40
SHCNE_DRIVEREMOVED = $80
SHCNE_DRIVEADD = $100
SHCNE_NETSHARE = $200
SHCNE_NETUNSHARE = $400
SHCNE_ATTRIBUTES = $800
SHCNE_UPDATEDIR = $1000
SHCNE_UPDATEITEM = $2000
SHCNE_SERVERDISCONNECT = $4000
SHCNE_UPDATEIMAGE = $8000
SHCNE_DRIVEADDGUI = $10000
SHCNE_RENAMEFOLDER = $20000
SHCNE_FREESPACE = $40000
SHCNE_EXTENDED_EVENT = $4000000
SHCNE_ASSOCCHANGED = $8000000
SHCNE_DISKEVENTS = $2381F
SHCNE_GLOBALEVENTS = $C0581E0
SHCNE_ALLEVENTS = $7FFFFFFF
SHCNE_INTERRUPT = $80000000

SHCNEE_ORDERCHANGED = 2
SHCNEE_MSI_CHANGE = 4
SHCNEE_MSI_UNINSTALL = 5

SHCNF_IDLIST = 0
SHCNF_PATHA = 1
SHCNF_PRINTERA = 2
SHCNF_DWORD = 3
SHCNF_PATHW = 5
SHCNF_PRINTERW = 6
SHCNF_TYPE = $FF
SHCNF_FLUSH = $1000
SHCNF_FLUSHNOWAIT = $2000

interface IShellChangeNotify,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  OnChange

interface IQueryInfo,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetInfoTip,\
	  GetInfoFlags

QITIPF_DEFAULT = 0
QITIPF_USENAME = 1
QITIPF_LINKNOTARGET = 2
QITIPF_LINKUSETARGET = 4
QITIPF_USESLOWTIP = 8

QIF_CACHED = 1
QIF_DONTEXPANDFOLDER = 2

SHARD_PIDL = 1
SHARD_PATHA = 2
SHARD_PATHW = 3

struct SHCHANGEDWORDASIDLIST
       cb dw ?
       dwItem1 dd ?
       dwItem2 dd ?
       cbZero dw ?
ends

struct SHCHANGEUPDATEIMAGEIDLIST
       cb dw ?
       iIconIndex dd ?
       iCurIndex dd ?
       uFlags dd ?
       dwProcessID dd ?
       szName dw MAX_PATH dup(?)
       cbZero dw ?
ends

struct SHCHANGEPRODUCTKEYASIDLIST
       cb dw ?
       wszProductKey du 39 dup(?)
       cbZero dw ?
ends

SHGDFIL_FINDDATA = 1
SHGDFIL_NETRESOURCE = 2
SHGDFIL_DESCRIPTIONID = 3

SHDID_ROOT_REGITEM = 1
SHDID_FS_FILE = 2
SHDID_FS_DIRECTORY = 3
SHDID_FS_OTHER = 4
SHDID_COMPUTER_DRIVE35 = 5
SHDID_COMPUTER_DRIVE525 = 6
SHDID_COMPUTER_REMOVABLE = 7
SHDID_COMPUTER_FIXED = 8
SHDID_COMPUTER_NETDRIVE = 9
SHDID_COMPUTER_CDROM = 10
SHDID_COMPUTER_RAMDISK	= 11
SHDID_COMPUTER_OTHER = 12
SHDID_NET_DOMAIN = 13
SHDID_NET_SERVER = 14
SHDID_NET_SHARE = 15
SHDID_NET_RESTOFNET = 16
SHDID_NET_OTHER = 17
SHDID_COMPUTER_IMAGING = 18
SHDID_COMPUTER_AUDIO = 19
SHDID_COMPUTER_SHAREDDOCS = 20

struct SHDESCRIPTIONID
       dwDescriptionId dd ?
       clsid GUID
ends

PRF_VERIFYEXISTS = 1
PRF_TRYPROGRAMEXTENSIONS = (2 or PRF_VERIFYEXISTS)
PRF_FIRSTDIRDEF = 4
PRF_DONTFINDLNK = 8

NUM_POINTS = 3

struct AUTOSCROLLDATA
       iNextSample dd ?
       dwLastScroll dd ?
       bFull dd ?
       pts POINT
	   db (NUM_POINTS-1)*sizeof.POINT dup(?)
       dwTimes dd NUM_POINTS dup(?)
ends

fFullPathTitle equ 1
fSaveLocalView equ (1 shl 1)
fNotShell equ (1 shl 2)
fSimpleDefault equ (1 shl 3)
fDontShowDescBar equ (1 shl 4)
fNewWindowMode equ (1 shl 5)
fShowCompColor equ (1 shl 6)
fDontPrettyNames equ (1 shl 7)
fAdminsCreateCommonGroups equ (1 shl 8)
fUnusedFlags equ (1111111b shl 9)

struct CABINETSTATE
       cLength dw ?
       nVersion dw ?
       cabinetstatebits dd ?
       fMenuEnumFilter dd ?
ends

CABINETSTATE_VERSION = 2

PCS_FATAL = $80000000
PCS_REPLACEDCHAR = 1
PCS_REMOVEDCHAR = 2
PCS_TRUNCATED = 4
PCS_PATHTOOLONG = 8

MM_ADDSEPARATOR = 1
MM_SUBMENUSHAVEIDS = 2
MM_DONTREMOVESEPS = 4

SHOP_PRINTERNAME = 1
SHOP_FILEPATH = 2
SHOP_VOLUMEGUID = 4

SHFMT_ID_DEFAULT = $FFFF

SHFMT_OPT_FULL = 1
SHFMT_OPT_SYSONLY = 2
SHFMT_ERROR = $FFFFFFFF
SHFMT_CANCEL = $FFFFFFFE
SHFMT_NOFORMAT = $FFFFFFFD

interface IDefViewFrame,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetWindowLV,\
	  ReleaseWindowLV,\
	  GetShellFolder

REST_NONE = 0
REST_NORUN = 1
REST_NOCLOSE = 2
REST_NOSAVESET = 4
REST_NOFILEMENU = 8
REST_NOSETFOLDERS = $10
REST_NOSETTASKBAR = $20
REST_NODESKTOP = $40
REST_NOFIND = $80
REST_NODRIVES = $100
REST_NODRIVEAUTORUN = $200
REST_NODRIVETYPEAUTORUN = $400
REST_NONETHOOD = $800
REST_STARTBANNER = $1000
REST_RESTRICTRUN = $2000
REST_NOPRINTERTABS = $4000
REST_NOPRINTERDELETE = $8000
REST_NOPRINTERADD = $10000
REST_NOSTARTMENUSUBFOLDERS = $20000
REST_MYDOCSONNET = $40000
REST_NOEXITTODOS = $80000
REST_ENFORCESHELLEXTSECURITY = $100000
REST_LINKRESOLVEIGNORELINKINFO = $200000
REST_NOCOMMONGROUPS = $400000
REST_SEPARATEDESKTOPPROCESS = $800000
REST_NOWEB = $1000000
REST_NOTRAYCONTEXTMENU = $2000000
REST_NOVIEWCONTEXTMENU = $4000000
REST_NONETCONNECTDISCONNECT = $8000000
REST_STARTMENULOGOFF = $10000000
REST_NOSETTINGSASSIST = $20000000
REST_NOINTERNETICON = $40000001
REST_NORECENTDOCSHISTORY = $40000002
REST_NORECENTDOCSMENU = $40000003
REST_NOACTIVEDESKTOP = $40000004
REST_NOACTIVEDESKTOPCHANGES = $40000005
REST_NOFAVORITESMENU = $40000006
REST_CLEARRECENTDOCSONEXIT = $40000007
REST_CLASSICSHELL = $40000008
REST_NOCUSTOMIZEWEBVIEW = $40000009
REST_NOHTMLWALLPAPER = $40000010
REST_NOCHANGINGWALLPAPER = $40000011
REST_NODESKCOMP = $40000012
REST_NOADDDESKCOMP = $40000013
REST_NODELDESKCOMP = $40000014
REST_NOCLOSEDESKCOMP = $40000015
REST_NOCLOSE_DRAGDROPBAND = $40000016
REST_NOMOVINGBAND = $40000017
REST_NOEDITDESKCOMP = $40000018
REST_NORESOLVESEARCH = $40000019
REST_NORESOLVETRACK = $4000001A
REST_FORCECOPYACLWITHFILE = $4000001B
REST_NOLOGO3CHANNELNOTIFY = $4000001C
REST_NOFORGETSOFTWAREUPDATE = $4000001D
REST_NOSETACTIVEDESKTOP = $4000001E
REST_NOUPDATEWINDOWS = $4000001F
REST_NOCHANGESTARMENU = $40000020
REST_NOFOLDEROPTIONS = $40000021
REST_HASFINDCOMPUTERS = $40000022
REST_INTELLIMENUS = $40000023
REST_RUNDLGMEMCHECKBOX = $40000024
REST_ARP_ShowPostSetup = $40000025
REST_NOCSC = $40000026
REST_NOCONTROLPANEL = $40000027
REST_ENUMWORKGROUP = $40000028
REST_ARP_NOARP = $40000029
REST_ARP_NOREMOVEPAGE = $4000002A
REST_ARP_NOADDPAGE = $4000002B
REST_ARP_NOWINSETUPPAGE = $4000002C
REST_GREYMSIADS = $4000002D
REST_NOCHANGEMAPPEDDRIVELABEL = $4000002E
REST_NOCHANGEMAPPEDDRIVECOMMENT = $4000002F
REST_MaxRecentDocs = $40000030
REST_NONETWORKCONNECTIONS = $40000031
REST_FORCESTARTMENULOGOFF = $40000032
REST_NOWEBVIEW = $40000033
REST_NOCUSTOMIZETHISFOLDER = $40000034
REST_NOENCRYPTION = $40000035
REST_DONTSHOWSUPERHIDDEN = $40000037
REST_NOSHELLSEARCHBUTTON = $40000038
REST_NOHARDWARETAB = $40000039
REST_NORUNASINSTALLPROMPT  = $4000003A
REST_PROMPTRUNASINSTALLNETPATH = $4000003B
REST_NOMANAGEMYCOMPUTERVERB = $4000003C
REST_NORECENTDOCSNETHOOD = $4000003D
REST_DISALLOWRUN = $4000003E
REST_NOWELCOMESCREEN = $4000003F
REST_RESTRICTCPL = $40000040
REST_DISALLOWCPL = $40000041
REST_NOSMBALLOONTIP  = $40000042
REST_NOSMHELP = $40000043
REST_NOWINKEYS = $40000044
REST_NOENCRYPTONMOVE = $40000045
REST_NOLOCALMACHINERUN = $40000046
REST_NOCURRENTUSERRUN = $40000047
REST_NOLOCALMACHINERUNONCE  = $40000048
REST_NOCURRENTUSERRUNONCE = $40000049
REST_FORCEACTIVEDESKTOPON = $4000004A
REST_NOCOMPUTERSNEARME = $4000004B
REST_NOVIEWONDRIVE = $4000004C
REST_NONETCRAWL = $4000004D
REST_NOSHAREDDOCUMENTS = $4000004E
REST_NOSMMYDOCS = $4000004F
REST_NOSMMYPICS = $40000050
REST_ALLOWBITBUCKDRIVES = $40000051
REST_NONLEGACYSHELLMODE = $40000052
REST_NOCONTROLPANELBARRICADE = $40000053
REST_NOSTARTPAGE = $40000054
REST_NOAUTOTRAYNOTIFY = $40000055
REST_NOTASKGROUPING = $40000056
REST_NOCDBURNING = $40000057
REST_MYCOMPNOPROP = $40000058
REST_MYDOCSNOPROP = $40000059
REST_NOSTARTPANEL = $4000005A
REST_NODISPLAYAPPEARANCEPAGE = $4000005B
REST_NOTHEMESTAB = $4000005C
REST_NOVISUALSTYLECHOICE = $4000005D
REST_NOSIZECHOICE = $4000005E
REST_NOCOLORCHOICE = $4000005F
REST_SETVISUALSTYLE = $40000060
REST_STARTRUNNOHOMEPATH = $40000061
REST_NOUSERNAMEINSTARTPANEL = $40000062
REST_NOMYCOMPUTERICON = $40000063
REST_NOSMNETWORKPLACES = $40000064
REST_NOSMPINNEDLIST = $40000065
REST_NOSMMYMUSIC = $40000066
REST_NOSMEJECTPC = $40000067
REST_NOSMMOREPROGRAMS = $40000068
REST_NOSMMFUPROGRAMS = $40000069
REST_NOTRAYITEMSDISPLAY = $4000006A
REST_NOTOOLBARSONTASKBAR = $4000006B
REST_NOSMCONFIGUREPROGRAMS = $4000006F
REST_HIDECLOCK = $40000070
REST_NOLOWDISKSPACECHECKS = $40000071
REST_NOENTIRENETWORK = $40000072
REST_NODESKTOPCLEANUP = $40000073
REST_BITBUCKNUKEONDELETE = $40000074
REST_BITBUCKCONFIRMDELETE = $40000075
REST_BITBUCKNOPROP = $40000076
REST_NODISPBACKGROUND = $40000077
REST_NODISPSCREENSAVEPG = $40000078
REST_NODISPSETTINGSPG = $40000079
REST_NODISPSCREENSAVEPREVIEW = $4000007A
REST_NODISPLAYCPL = $4000007B
REST_HIDERUNASVERB = $4000007C
REST_NOTHUMBNAILCACHE = $4000007D
REST_NOSTRCMPLOGICAL = $4000007E
REST_NOPUBLISHWIZARD = $4000007F
REST_NOONLINEPRINTSWIZARD = $40000080
REST_NOWEBSERVICES = $40000081
REST_ALLOWUNHASHEDWEBVIEW = $40000082
REST_ALLOWLEGACYWEBVIEW = $40000083
REST_REVERTWEBVIEWSECURITY = $40000084
REST_INHERITCONSOLEHANDLES = $40000086
REST_SORTMAXITEMCOUNT = $40000087
REST_NOREMOTERECURSIVEEVENTS = $40000089
REST_NOREMOTECHANGENOTIFY = $40000091
REST_NOSIMPLENETIDLIST = $40000092
REST_NOENUMENTIRENETWORK = $40000093
REST_NODETAILSTHUMBNAILONNETWORK= $40000094
REST_NOINTERNETOPENWITH = $40000095
REST_ALLOWLEGACYLMZBEHAVIOR = $4000009A
REST_DONTRETRYBADNETNAME = $4000009B
REST_ALLOWFILECLSIDJUNCTIONS = $4000009C
REST_NOUPNPINSTALL = $4000009D
REST_NODISCONNECT = $41000001
REST_NOSECURITY = $41000002
REST_NOFILEASSOCIATE = $41000003
REST_ALLOWCOMMENTTOGGLE = $41000004
REST_USEDESKTOPINICACHE = $41000005

PPCF_ADDQUOTES = 1
PPCF_ADDARGUMENTS = 3
PPCF_NODIRECTORIES = $10
PPCF_FORCEQUALIFY = $40
PPCF_LONGESTPOSSIBLE = $80

interface IDocViewSite,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  OnSetTitle

VALIDATEUNC_NOUI = 2
VALIDATEUNC_CONNECT = 1
VALIDATEUNC_PRINT = 4
VALIDATEUNC_VALID = 7

OPENPROPS_NONE = 0
OPENPROPS_INHIBITPIF = $8000
GETPROPS_NONE = 0
SETPROPS_NONE = 0
CLOSEPROPS_NONE = 0
CLOSEPROPS_DISCARD = 1

PIFNAMESIZE = 30
PIFSTARTLOCSIZE = 63
PIFDEFPATHSIZE = 64
PIFPARAMSSIZE = 64
PIFSHPROGSIZE = 64
PIFSHDATASIZE = 64
PIFDEFFILESIZE = 80
PIFMAXFILEPATH = 260

struct PROPPRG
       flPrg dw ?
       flPrgInit dw ?
       achTitle db PIFNAMESIZE dup(?)
       achCmdLine db PIFSTARTLOCSIZE+PIFPARAMSSIZE+1 dup(?)
       achWorkDir db PIFDEFPATHSIZE dup(?)
       wHotKey dw ?
       achIconFile db PIFDEFFILESIZE dup(?)
       wIconIndex dw ?
       dwEnhModeFlags dd ?
       dwRealModeFlags dd ?
       achOtherFile db PIFDEFFILESIZE dup(?)
       achPIFFile db PIFMAXFILEPATH dup(?)
ends

interface IInitializeObject,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Initialize

BMICON_LARGE = 0
BMICON_SMALL = 1

interface IBanneredBar,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetIconSize,\
	  GetIconSize,\
	  SetBitmap,\
	  GetBitmap

interface IShellFolderViewCB,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  MessageSFVCB


QCMINFO_PLACE_BEFORE = 0
QCMINFO_PLACE_AFTER = 1

struct QCMINFOIDMAPPLACEMENT
       id dd ?
       fFlags dd ?
ends

struct QCMINFOIDMAP
       nMaxIds dd ?
       pIdList QCMINFOIDMAPPLACEMENT
ends

struct QCMINFO
       hmenu dq ?
       indexMenu dd ?
       idCmdFirst dd ?
       idCmdLast dd ?,?
       pIdMap dq ?
ends

TBIF_APPEND = 0
TBIF_PREPEND = 1
TBIF_REPLACE = 2
TBIF_DEFAULT = 0
TBIF_INTERNETBAR = $10000
TBIF_STANDARDTOOLBAR = $20000
TBIF_NOTOOLBAR = $30000

struct TBINFO
       cbuttons dd ?
       uFlags dd ?
ends

struct DETAILSINFO
       pidl dq ?
       fmt dd ?
       cxChar dd ?
       str STRRET
       iImage dd ?,?
ends

struct SFVMPROPPAGEDATA
       dwReserved dd ?,?
       pfn dq ?
       lParam dq ?
ends

struct SFVMHELPTOPICDATA
       wszHelpFile du MAX_PATH dup(?)
       wszHelpTopic du MAX_PATH dup(?)
ends

SFVM_MERGEMENU = 1
SFVM_INVOKECOMMAND = 2
SFVM_GETHELPTEXT = 3
SFVM_GETTOOLTIPTEXT = 4
SFVM_GETBUTTONINFO = 5
SFVM_GETBUTTONS = 6
SFVM_INITMENUPOPUP = 7
SFVM_FSNOTIFY = 14
SFVM_WINDOWCREATED = 15
SFVM_GETDETAILSOF = 23
SFVM_COLUMNCLICK = 24
SFVM_QUERYFSNOTIFY = 25
SFVM_DEFITEMCOUNT = 26
SFVM_DEFVIEWMODE = 27
SFVM_UNMERGEMENU = 28
SFVM_UPDATESTATUSBAR = 31
SFVM_BACKGROUNDENUM = 32
SFVM_DIDDRAGDROP = 36
SFVM_SETISFV = 39
SFVM_THISIDLIST = 41
SFVM_ADDPROPERTYPAGES = 47
SFVM_BACKGROUNDENUMDONE = 48
SFVM_GETNOTIFY = 49
SFVM_GETSORTDEFAULTS = 53
SFVM_SIZE = 57
SFVM_GETZONE = 58
SFVM_GETPANE = 59
SFVM_GETHELPTOPIC = 63
SFVM_GETANIMATION = 68

struct SFVCREATE
       cbSize dd ?,?
       pshf dq ?
       psvOuter dq ?
       psfvcb dq ?
ends

DFM_MERGECONTEXTMENU = 1
DFM_INVOKECOMMAND = 2
DFM_GETDEFSTATICID = 14
DFM_CMD_PROPERTIES = -5

struct CSFV
       cbSize dd ?,?
       pshf dq ?
       psvOuter dq ?
       pidl dq ?
       lEvents dd ?,?
       pfnCallback dq ?
       fvm dd ?,?
ends

SFVM_REARRANGE = 1
SFVM_ADDOBJECT = 3
SFVM_REMOVEOBJECT = 6
SFVM_UPDATEOBJECT = 7
SFVM_GETSELECTEDOBJECTS = 9

struct SFVSETITEMPOS
       pidl dq ?
       pt POINT
ends

SFVM_SETITEMPOS = $e
SFVM_SETCLIPBOARD = $10
SFVM_SETPOINTS = $17

PID_IS_URL = 2
PID_IS_NAME = 4
PID_IS_WORKINGDIR = 5
PID_IS_HOTKEY = 6
PID_IS_SHOWCMD = 7
PID_IS_ICONINDEX = 8
PID_IS_ICONFILE = 9
PID_IS_WHATSNEW = 10
PID_IS_AUTHOR = 11
PID_IS_DESCRIPTION = 12
PID_IS_COMMENT = 13

PID_INTSITE_WHATSNEW = 2
PID_INTSITE_AUTHOR = 3
PID_INTSITE_LASTVISIT = 4
PID_INTSITE_LASTMOD = 5
PID_INTSITE_VISITCOUNT = 6
PID_INTSITE_DESCRIPTION = 7
PID_INTSITE_COMMENT = 8
PID_INTSITE_FLAGS = 9
PID_INTSITE_CONTENTLEN = 10
PID_INTSITE_CONTENTCODE = 11
PID_INTSITE_RECURSE = 12
PID_INTSITE_WATCH = 13
PID_INTSITE_SUBSCRIPTION = 14
PID_INTSITE_URL = 15
PID_INTSITE_TITLE = 16
PID_INTSITE_CODEPAGE = 18
PID_INTSITE_TRACKING = 19
PID_INTSITE_ICONINDEX = 20
PID_INTSITE_ICONFILE = 21

PIDISF_RECENTLYCHANGED = 1
PIDISF_CACHEDSTICKY = 2
PIDISF_CACHEIMAGES = $10
PIDISF_FOLLOWALLLINKS = $20

PIDISM_GLOBAL = 0
PIDISM_WATCH = 1
PIDISM_DONTWATCH = 2

struct SHELLSTATEA
       ShellStateFlags dd ?
       dwWin95Unused dd ?
       uWin95Unused dd ?
       lParamSort dd ?
       iSortDirection dd ?
       version dd ?
       uNotUsed dd ?
       ShellStateFlags2 dd ?
ends

struct SHELLSTATEW
       ShellStateFlags dd ?
       dwWin95Unused dd ?
       uWin95Unused dd ?
       lParamSort dd ?
       iSortDirection dd ?
       version dd ?
       uNotUsed dd ?
       ShellStateFlags2 dd ?
ends

SHELLSTATEVERSION_IE4 = 9
SHELLSTATEVERSION_WIN2K = 10

;#define SHELLSTATE_SIZE_WIN95 FIELD_OFFSET(SHELLSTATE,lParamSort)
;#define SHELLSTATE_SIZE_NT4   FIELD_OFFSET(SHELLSTATE,version)
;#define SHELLSTATE_SIZE_IE4   FIELD_OFFSET(SHELLSTATE,uNotUsed)
;#define SHELLSTATE_SIZE_WIN2K sizeof(SHELLSTATE)

SSF_SHOWALLOBJECTS = 1
SSF_SHOWEXTENSIONS = 2
SSF_HIDDENFILEEXTS = 4
SSF_SERVERADMINUI = 4
SSF_SHOWCOMPCOLOR = 8
SSF_SORTCOLUMNS = $10
SSF_SHOWSYSFILES = $20
SSF_DOUBLECLICKINWEBVIEW = $80
SSF_SHOWATTRIBCOL = $100
SSF_DESKTOPHTML = $200
SSF_WIN95CLASSIC = $400
SSF_DONTPRETTYPATH = $800
SSF_SHOWINFOTIP = $2000
SSF_MAPNETDRVBUTTON = $1000
SSF_NOCONFIRMRECYCLE = $8000
SSF_HIDEICONS = $4000
SSF_FILTER = $10000
SSF_WEBVIEW = $20000
SSF_SHOWSUPERHIDDEN = $40000
SSF_SEPPROCESS = $80000
SSF_NONETCRAWLING = $100000
SSF_STARTPANELON = $200000
SSF_SHOWSTARTPAGE = $400000

SHPPFW_NONE = 0
SHPPFW_DEFAULT = SHPPFW_DIRCREATE
SHPPFW_DIRCREATE = 1
SHPPFW_ASKDIRCREATE = 2
SHPPFW_IGNOREFILENAME = 4
SHPPFW_NOWRITECHECK = 8
SHPPFW_MEDIACHECKONLY = 10

interface INamedPropertyBag,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  ReadPropertyNPB,\
	  WritePropertyNPB,\
	  RemovePropertyNPB

struct AAMENUFILENAME
       cbTotal dw ?
       rgbReserved db 12 dup(?)
       szFileName dw ?
ends

struct AASHELLMENUITEM
       lpReserved1 dq ?
       iReserved dd ?
       uiReserved dd ?
       lpName dq ?
       psz dq ?
ends


;winuser.h -- USER procedure declarations, constant definitions and macros,
;             also uxtheme.h after gdi defines
;Copyright (c) Microsoft Corporation. All rights reserved.
LF_FACESIZE = 32

struct USERLOGFONT
       lfHeight dd ?
       lfWidth dd ?
       lfEscapement dd ?
       lfOrientation dd ?
       lfWeight dd ?
       lfItalic db ?
       lfUnderline db ?
       lfStrikeOut db ?
       lfCharSet db ?
       lfOutPrecision db ?
       lfClipPrecision db ?
       lfQuality db ?
       lfPitchAndFamily db ?
       lfFaceName TCHAR LF_FACESIZE dup(?)
ends
;--------------------------------------------------------------------
WM_DDE_FIRST = $3E0
WM_DDE_INITIATE = (WM_DDE_FIRST)
WM_DDE_TERMINATE = (WM_DDE_FIRST+1)
WM_DDE_ADVISE = (WM_DDE_FIRST+2)
WM_DDE_UNADVISE  = (WM_DDE_FIRST+3)
WM_DDE_ACK = (WM_DDE_FIRST+4)
WM_DDE_DATA = (WM_DDE_FIRST+5)
WM_DDE_REQUEST = (WM_DDE_FIRST+6)
WM_DDE_POKE = (WM_DDE_FIRST+7)
WM_DDE_EXECUTE = (WM_DDE_FIRST+8)
WM_DDE_LAST = (WM_DDE_FIRST+8)

HDS_HORZ = 0
HDS_BUTTONS = 2
HDS_HOTTRACK = 4
HDS_HIDDEN = 8
HDS_DRAGDROP = $40
HDS_FULLDRAG = $80
RBS_TOOLTIPS = $100
RBS_VARHEIGHT = $200
RBS_BANDBORDERS = $400
RBS_FIXEDORDER = $800
RBS_REGISTERDROP = $1000
RBS_AUTOSIZE = $2000
RBS_VERTICALGRIPPER = $4000
RBS_DBLCLKTOGGLE = $8000

TTS_ALWAYSTIP = 1
TTS_NOPREFIX = 2

SBARS_SIZEGRIP = $100

TBS_AUTOTICKS = 1
TBS_VERT = 2
TBS_HORZ = 0
TBS_TOP = 4
TBS_BOTTOM = 0
TBS_LEFT = 4
TBS_RIGHT = 0
TBS_BOTH = 8
TBS_NOTICKS = $10
TBS_ENABLESELRANGE = $20
TBS_FIXEDLENGTH = $40
TBS_NOTHUMB = $80
TBS_TOOLTIPS = $100

UDS_WRAP = 1
UDS_SETBUDDYINT = 2
UDS_ALIGNRIGHT = 4
UDS_ALIGNLEFT = 8
UDS_AUTOBUDDY = $10
UDS_ARROWKEYS = $20
UDS_HORZ = $40
UDS_NOTHOUSANDS = $80
UDS_HOTTRACK = $100

PBS_SMOOTH = 1
PBS_VERTICAL = 4

CCS_TOP = 1
CCS_NOMOVEY = 2
CCS_BOTTOM = 3
CCS_NORESIZE = 4
CCS_NOPARENTALIGN = 8
CCS_ADJUSTABLE = $20
CCS_NODIVIDER = $40
CCS_VERT = $80
CCS_LEFT = (CCS_VERT or CCS_TOP)
CCS_RIGHT = (CCS_VERT or CCS_BOTTOM)
CCS_NOMOVEX = (CCS_VERT or CCS_NOMOVEY)

LVS_ICON = 0
LVS_REPORT = 1
LVS_SMALLICON = 2
LVS_LIST = 3
LVS_TYPEMASK = 3
LVS_SINGLESEL = 4
LVS_SHOWSELALWAYS = 8
LVS_SORTASCENDING = 10
LVS_SORTDESCENDING = 20
LVS_SHAREIMAGELISTS = 40
LVS_NOLABELWRAP = 80
LVS_AUTOARRANGE = $100
LVS_EDITLABELS = $200
LVS_OWNERDATA = $1000
LVS_NOSCROLL = $2000
LVS_TYPESTYLEMASK = $fc00
LVS_ALIGNTOP = 0
LVS_ALIGNLEFT = $800
LVS_ALIGNMASK = $c00
LVS_OWNERDRAWFIXED = $400
LVS_NOCOLUMNHEADER = $4000
LVS_NOSORTHEADER = $8000
TVS_HASBUTTONS = 1
TVS_HASLINES = 2
TVS_LINESATROOT = 4
TVS_EDITLABELS = 8
TVS_DISABLEDRAGDROP = $10
TVS_SHOWSELALWAYS = $20
TVS_RTLREADING = $40
TVS_NOTOOLTIPS = $80
TVS_CHECKBOXES = $100
TVS_TRACKSELECT = $200
TVS_SINGLEEXPAND = $400
TVS_INFOTIP = $800
TVS_FULLROWSELECT = $1000
TVS_NOSCROLL = $2000
TVS_NONEVENHEIGHT = $4000

TCS_SCROLLOPPOSITE = 1
TCS_BOTTOM = 2
TCS_RIGHT = 2
TCS_MULTISELECT = 4
TCS_FLATBUTTONS = 8
TCS_FORCEICONLEFT = $10
TCS_FORCELABELLEFT = $20
TCS_HOTTRACK = $40
TCS_VERTICAL = $80
TCS_TABS = 0
TCS_BUTTONS = $100
TCS_SINGLELINE = 0
TCS_MULTILINE = $200
TCS_RIGHTJUSTIFY = 0
TCS_FIXEDWIDTH = $400
TCS_RAGGEDRIGHT = $800
TCS_FOCUSONBUTTONDOWN = $1000
TCS_OWNERDRAWFIXED = $2000
TCS_TOOLTIPS = $4000
TCS_FOCUSNEVER = $8000

ACS_CENTER = 1
ACS_TRANSPARENT = 2
ACS_AUTOPLAY = 4
ACS_TIMER = 8

DTS_UPDOWN = 1
DTS_SHOWNONE = 2
DTS_SHORTDATEFORMAT = 0
DTS_LONGDATEFORMAT = 4
DTS_TIMEFORMAT = 9
DTS_APPCANPARSE = $10
DTS_RIGHTALIGN = $20

PGS_VERT = 0
PGS_HORZ = 1
PGS_AUTOSCROLL = 2
PGS_DRAGNDROP = 4

NFS_EDIT = 1
NFS_STATIC = 2
NFS_LISTCOMBO = 4
NFS_BUTTON = 8
NFS_ALL = $10

RT_CURSOR = 1
RT_BITMAP = 2
RT_ICON = 3
RT_MENU = 4
RT_DIALOG = 5
RT_STRING = 6
RT_FONTDIR = 7
RT_FONT = 8
RT_ACCELERATOR = 9
RT_RCDATA = 10
RT_MESSAGETABLE = 11
DIFFERENCE = 11
RT_GROUP_CURSOR = RT_CURSOR + DIFFERENCE
RT_GROUP_ICON = RT_ICON + DIFFERENCE
RT_VERSION = 16
RT_DLGINCLUDE = 17
RT_PLUGPLAY = 19
RT_VXD = 20
RT_ANICURSOR = 21
RT_ANIICON = 22
RT_HTML = 23
RT_MANIFEST = 24

CREATEPROCESS_MANIFEST_RESOURCE_ID = 1
ISOLATIONAWARE_MANIFEST_RESOURCE_ID = 2
ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID = 3
MINIMUM_RESERVED_MANIFEST_RESOURCE_ID = 1
MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID = 16

SB_HORZ = 0
SB_VERT = 1
SB_CTL = 2
SB_BOTH = 3
SB_LINEUP = 0
SB_LINELEFT = 0
SB_LINEDOWN = 1
SB_LINERIGHT = 1
SB_PAGEUP = 2
SB_PAGELEFT = 2
SB_PAGEDOWN = 3
SB_PAGERIGHT = 3
SB_THUMBPOSITION = 4
SB_THUMBTRACK = 5
SB_TOP = 6
SB_LEFT = 6
SB_BOTTOM = 7
SB_RIGHT = 7
SB_ENDSCROLL = 8

SW_HIDE = 0
SW_SHOWNORMAL = 1
SW_NORMAL = 1
SW_SHOWMINIMIZED = 2
SW_SHOWMAXIMIZED = 3
SW_MAXIMIZE = 3
SW_SHOWNOACTIVATE = 4
SW_SHOW = 5
SW_MINIMIZE = 6
SW_SHOWMINNOACTIVE = 7
SW_SHOWNA = 8
SW_RESTORE = 9
SW_SHOWDEFAULT = 10
SW_FORCEMINIMIZE = 11
SW_MAX = 11

HIDE_WINDOW = 0
SHOW_OPENWINDOW = 1
SHOW_ICONWINDOW = 2
SHOW_FULLSCREEN = 3
SHOW_OPENNOACTIVATE = 4

SW_PARENTCLOSING = 1
SW_OTHERZOOM = 2
SW_PARENTOPENING = 3
SW_OTHERUNZOOM = 4

AW_HOR_POSITIVE = 1
AW_HOR_NEGATIVE = 2
AW_VER_POSITIVE = 4
AW_VER_NEGATIVE = 8
AW_CENTER = $10
AW_HIDE = $10000
AW_ACTIVATE = $20000
AW_SLIDE = $40000
AW_BLEND = $80000

KF_EXTENDED = $100
KF_DLGMODE = $800
KF_MENUMODE = $1000
KF_ALTDOWN = $2000
KF_REPEAT = $4000
KF_UP = $8000

VK_LBUTTON = 1
VK_RBUTTON = 2
VK_CANCEL = 3
VK_MBUTTON = 4
VK_XBUTTON1 = 5
VK_XBUTTON2 = 6
VK_BACK = 8
VK_TAB = 9
VK_CLEAR = $C
VK_RETURN = $D
VK_SHIFT = $10
VK_CONTROL = $11
VK_MENU = $12
VK_PAUSE = $13
VK_CAPITAL = $14
VK_KANA = $15
VK_HANGEUL = $15
VK_HANGUL = $15
VK_JUNJA = $17
VK_FINAL = $18
VK_HANJA = $19
VK_KANJI = $19
VK_ESCAPE = $1B
VK_CONVERT = $1C
VK_NONCONVERT = $1D
VK_ACCEPT = $1E
VK_MODECHANGE = $1F
VK_SPACE = $20
VK_PGUP = 021h
VK_PGDN = 022h
VK_END = $23
VK_HOME = $24
VK_LEFT = $25
VK_UP = $26
VK_RIGHT = $27
VK_DOWN = $28
VK_SELECT = $29
VK_PRINT = $2A
VK_EXECUTE = $2B
VK_SNAPSHOT = $2C
VK_INSERT = $2D
VK_DELETE = $2E
VK_HELP = $2F
VK_LWIN = $5B
VK_RWIN = $5C
VK_APPS = $5D
VK_SLEEP = $5F
VK_NUMPAD0 = $60
VK_NUMPAD1 = $61
VK_NUMPAD2 = $62
VK_NUMPAD3 = $63
VK_NUMPAD4 = $64
VK_NUMPAD5 = $65
VK_NUMPAD6 = $66
VK_NUMPAD7 = $67
VK_NUMPAD8 = $68
VK_NUMPAD9 = $69
VK_MULTIPLY = $6A
VK_ADD = $6B
VK_SEPARATOR = $6C
VK_SUBTRACT = $6D
VK_DECIMAL = $6E
VK_DIVIDE = $6F
VK_F1 = $70
VK_F2 = $71
VK_F3 = $72
VK_F4 = $73
VK_F5 = $74
VK_F6 = $75
VK_F7 = $76
VK_F8 = $77
VK_F9 = $78
VK_F10 = $79
VK_F11 = $7A
VK_F12 = $7B
VK_F13 = $7C
VK_F14 = $7D
VK_F15 = $7E
VK_F16 = $7F
VK_F17 = $80
VK_F18 = $81
VK_F19 = $82
VK_F20 = $83
VK_F21 = $84
VK_F22 = $85
VK_F23 = $86
VK_F24 = $87
VK_NUMLOCK = $90
VK_SCROLL = $91
VK_OEM_NEC_EQUAL = $92
VK_OEM_FJ_JISHO = $92
VK_OEM_FJ_MASSHOU = $93
VK_OEM_FJ_TOUROKU = $94
VK_OEM_FJ_LOYA = $95
VK_OEM_FJ_ROYA = $96
VK_LSHIFT = $A0
VK_RSHIFT = $A1
VK_LCONTROL = $A2
VK_RCONTROL = $A3
VK_LMENU = $A4
VK_RMENU = $A5
VK_BROWSER_BACK = $A6
VK_BROWSER_FORWARD = $A7
VK_BROWSER_REFRESH = $A8
VK_BROWSER_STOP = $A9
VK_BROWSER_SEARCH = $AA
VK_BROWSER_FAVORITES = $AB
VK_BROWSER_HOME = $AC
VK_VOLUME_MUTE = $AD
VK_VOLUME_DOWN = $AE
VK_VOLUME_UP = $AF
VK_MEDIA_NEXT_TRACK = $B0
VK_MEDIA_PREV_TRACK = $B1
VK_MEDIA_STOP = $B2
VK_MEDIA_PLAY_PAUSE = $B3
VK_LAUNCH_MAIL = $B4
VK_LAUNCH_MEDIA_SELECT = $B5
VK_LAUNCH_APP1 = $B6
VK_LAUNCH_APP2 = $B7
VK_OEM_1 = $BA
VK_OEM_PLUS = $BB
VK_OEM_COMMA = $BC
VK_OEM_MINUS = $BD
VK_OEM_PERIOD = $BE
VK_OEM_2 = $BF
VK_OEM_3 = $C0
VK_OEM_4 = $DB
VK_OEM_5 = $DC
VK_OEM_6 = $DD
VK_OEM_7 = $DE
VK_OEM_8 = $DF
VK_OEM_AX = $E1
VK_OEM_102 = $E2
VK_ICO_HELP = $E3
VK_ICO_00 = $E4
VK_PROCESSKEY = $E5
VK_ICO_CLEAR = $E6
VK_PACKET = $E7
VK_OEM_RESET = $E9
VK_OEM_JUMP = $EA
VK_OEM_PA1 = $EB
VK_OEM_PA2 = $EC
VK_OEM_PA3 = $ED
VK_OEM_WSCTRL = $EE
VK_OEM_CUSEL = $EF
VK_OEM_ATTN = $F0
VK_OEM_FINISH = $F1
VK_OEM_COPY = $F2
VK_OEM_AUTO = $F3
VK_OEM_ENLW = $F4
VK_OEM_BACKTAB = $F5
VK_ATTN = $F6
VK_CRSEL = $F7
VK_EXSEL = $F8
VK_EREOF = $F9
VK_PLAY = $FA
VK_ZOOM = $FB
VK_NONAME = $FC
VK_PA1 = $FD
VK_OEM_CLEAR = $FE

WH_MIN = -1
WH_MSGFILTER = -1
WH_JOURNALRECORD = 0
WH_JOURNALPLAYBACK  = 1
WH_KEYBOARD = 2
WH_GETMESSAGE = 3
WH_CALLWNDPROC = 4
WH_CBT = 5
WH_SYSMSGFILTER = 6
WH_MOUSE = 7
WH_HARDWARE = 8
WH_DEBUG = 9
WH_SHELL = 10
WH_FOREGROUNDIDLE = 11
WH_CALLWNDPROCRET = 12
WH_KEYBOARD_LL = 13
WH_MOUSE_LL = 14
WH_MAX = 14
WH_MINHOOK = WH_MIN
WH_MAXHOOK = WH_MAX

HC_ACTION = 0
HC_GETNEXT = 1
HC_SKIP = 2
HC_NOREMOVE = 3
HC_NOREM = HC_NOREMOVE
HC_SYSMODALON = 4
HC_SYSMODALOFF = 5

HCBT_MOVESIZE  = 0
HCBT_MINMAX = 1
HCBT_QS = 2
HCBT_CREATEWND = 3
HCBT_DESTROYWND = 4
HCBT_ACTIVATE = 5
HCBT_CLICKSKIPPED = 6
HCBT_KEYSKIPPED = 7
HCBT_SYSCOMMAND = 8
HCBT_SETFOCUS = 9

struct CBTCREATEWNDA
       lpcs dq ?
       hwndInsertAfter dq ?
ends

struct CBTCREATEWNDW
       lpcs dq ?
       hwndInsertAfter dq ?
ends

struct CBTACTIVATESTRUCT
       fMouse dd ?,?
       hWndActive dq ?
ends

struct WTSSESSIONNOTIFICATION
       cbSize dd ?
       dwSessionId dd ?
ends

WTS_CONSOLE_CONNECT = 1
WTS_CONSOLE_DISCONNECT = 2
WTS_REMOTE_CONNECT = 3
WTS_REMOTE_DISCONNECT = 4
WTS_SESSION_LOGON = 5
WTS_SESSION_LOGOFF = 6
WTS_SESSION_LOCK = 7
WTS_SESSION_UNLOCK = 8
WTS_SESSION_REMOTE_CONTROL = 9

MSGF_DIALOGBOX = 0
MSGF_MESSAGEBOX = 1
MSGF_MENU = 2
MSGF_SCROLLBAR = 5
MSGF_NEXTWINDOW = 6
MSGF_MAX = 8
MSGF_USER = 4096

HSHELL_WINDOWCREATED = 1
HSHELL_WINDOWDESTROYED = 2
HSHELL_ACTIVATESHELLWINDOW = 3

HSHELL_WINDOWACTIVATED = 4
HSHELL_GETMINRECT = 5
HSHELL_REDRAW = 6
HSHELL_TASKMAN = 7
HSHELL_LANGUAGE = 8
HSHELL_SYSMENU = 9
HSHELL_ENDTASK = 10
HSHELL_ACCESSIBILITYSTATE = 11
HSHELL_APPCOMMAND = 12
HSHELL_WINDOWREPLACED = 13
HSHELL_WINDOWREPLACING = 14
HSHELL_HIGHBIT = $8000
HSHELL_FLASH =	(HSHELL_REDRAW or HSHELL_HIGHBIT)
HSHELL_RUDEAPPACTIVATED = (HSHELL_WINDOWACTIVATED or HSHELL_HIGHBIT)

ACCESS_STICKYKEYS = 1
ACCESS_FILTERKEYS = 2
ACCESS_MOUSEKEYS = 3

APPCOMMAND_BROWSER_BACKWARD  = 1
APPCOMMAND_BROWSER_FORWARD = 2
APPCOMMAND_BROWSER_REFRESH = 3
APPCOMMAND_BROWSER_STOP = 4
APPCOMMAND_BROWSER_SEARCH = 5
APPCOMMAND_BROWSER_FAVORITES = 6
APPCOMMAND_BROWSER_HOME = 7
APPCOMMAND_VOLUME_MUTE = 8
APPCOMMAND_VOLUME_DOWN = 9
APPCOMMAND_VOLUME_UP = 10
APPCOMMAND_MEDIA_NEXTTRACK = 11
APPCOMMAND_MEDIA_PREVIOUSTRACK = 12
APPCOMMAND_MEDIA_STOP = 13
APPCOMMAND_MEDIA_PLAY_PAUSE = 14
APPCOMMAND_LAUNCH_MAIL = 15
APPCOMMAND_LAUNCH_MEDIA_SELECT = 16
APPCOMMAND_LAUNCH_APP1 = 17
APPCOMMAND_LAUNCH_APP2 = 18
APPCOMMAND_BASS_DOWN = 19
APPCOMMAND_BASS_BOOST = 20
APPCOMMAND_BASS_UP = 21
APPCOMMAND_TREBLE_DOWN = 22
APPCOMMAND_TREBLE_UP = 23
APPCOMMAND_MICROPHONE_VOLUME_MUTE = 24
APPCOMMAND_MICROPHONE_VOLUME_DOWN = 25
APPCOMMAND_MICROPHONE_VOLUME_UP   = 26
APPCOMMAND_HELP = 27
APPCOMMAND_FIND = 28
APPCOMMAND_NEW = 29
APPCOMMAND_OPEN = 30
APPCOMMAND_CLOSE = 31
APPCOMMAND_SAVE = 32
APPCOMMAND_PRINT = 33
APPCOMMAND_UNDO = 34
APPCOMMAND_REDO = 35
APPCOMMAND_COPY = 36
APPCOMMAND_CUT = 37
APPCOMMAND_PASTE = 38
APPCOMMAND_REPLY_TO_MAIL = 39
APPCOMMAND_FORWARD_MAIL = 40
APPCOMMAND_SEND_MAIL = 41
APPCOMMAND_SPELL_CHECK = 42
APPCOMMAND_DICTATE_OR_COMMAND_CONTROL_TOGGLE = 43
APPCOMMAND_MIC_ON_OFF_TOGGLE = 44
APPCOMMAND_CORRECTION_LIST = 45
APPCOMMAND_MEDIA_PLAY = 46
APPCOMMAND_MEDIA_PAUSE = 47
APPCOMMAND_MEDIA_RECORD = 48
APPCOMMAND_MEDIA_FAST_FORWARD = 49
APPCOMMAND_MEDIA_REWIND = 50
APPCOMMAND_MEDIA_CHANNEL_UP = 51
APPCOMMAND_MEDIA_CHANNEL_DOWN = 52

FAPPCOMMAND_MOUSE = $8000
FAPPCOMMAND_KEY = 0
FAPPCOMMAND_OEM = $1000
FAPPCOMMAND_MASK = $F000

struct SHELLHOOKINFO
       hwnd dq ?
       rc RECT
ends

struct EVENTMSG
       message dd ?
       paramL dd ?
       paramH dd ?
       time dd ?
       hwnd dq ?
ends

struct CWPSTRUCT
       lParam dq ?
       wParam dq ?
       message dd ?,?
       hwnd dq ?
ends

struct CWPRETSTRUCT
       lResult dd ?,?
       lParam dq ?
       wParam dq ?
       message dd ?,?
       hwnd dq ?
ends

LLKHF_EXTENDED = (KF_EXTENDED shr 8)
LLKHF_INJECTED = $10
LLKHF_ALTDOWN  = (KF_ALTDOWN shr 8)
LLKHF_UP = (KF_UP shr 8)
LLMHF_INJECTED = 1

struct KBDLLHOOKSTRUCT
       vkCode dd ?
       scanCode dd ?
       flags dd ?
       time dd ?
       dwExtraInfo dq ?
ends

struct MSLLHOOKSTRUCT
       pt POINT
       mouseData dd ?
       flags dd ?
       time dd ?
       dwExtraInfo dq ?
ends

struct DEBUGHOOKINFO
       idThread dd ?
       idThreadInstaller dd ?
       lParam dq ?
       wParam dq ?
       code dd ?,?
ends

struct MOUSEHOOKSTRUCT
       pt POINT
       hwnd dq ?
       wHitTestCode dd ?,?
       dwExtraInfo dq ?
ends

struct MOUSEHOOKSTRUCTEX
       mousehookstruct MOUSEHOOKSTRUCT
       mouseData dd ?,?
ends

struct HARDWAREHOOKSTRUCT
       hwnd dq ?
       message dd ?,?
       wParam dq ?
       lParam dq ?
ends

HKL_PREV = 0
HKL_NEXT = 1
KLF_ACTIVATE = 1
KLF_SUBSTITUTE_OK = 2
KLF_REORDER = 8
KLF_REPLACELANG = $10
KLF_NOTELLSHELL = $80
KLF_SETFORPROCESS = $100
KLF_SHIFTLOCK = $10000
KLF_RESET = $40000000

INPUTLANGCHANGE_SYSCHARSET = 1
INPUTLANGCHANGE_FORWARD = 2
INPUTLANGCHANGE_BACKWARD = 4
KL_NAMELENGTH = 9

struct MOUSEMOVEPOINT
       x dd ?
       y dd ?
       time dd ?,?
       dwExtraInfo dq ?
ends

GMMP_USE_DISPLAY_POINTS = 1
GMMP_USE_HIGH_RESOLUTION_POINTS = 2

DESKTOP_READOBJECTS = 1
DESKTOP_CREATEWINDOW = 2
DESKTOP_CREATEMENU = 4
DESKTOP_HOOKCONTROL = 8
DESKTOP_JOURNALRECORD = $10
DESKTOP_JOURNALPLAYBACK = $20
DESKTOP_ENUMERATE = $40
DESKTOP_WRITEOBJECTS = $80
DESKTOP_SWITCHDESKTOP = $100

DF_ALLOWOTHERACCOUNTHOOK = 1

WINSTA_ENUMDESKTOPS = 1
WINSTA_READATTRIBUTES = 2
WINSTA_ACCESSCLIPBOARD = 4
WINSTA_CREATEDESKTOP = 8
WINSTA_WRITEATTRIBUTES = $10
WINSTA_ACCESSGLOBALATOMS = $20
WINSTA_EXITWINDOWS = $40
WINSTA_ENUMERATE = $100
WINSTA_READSCREEN = $200
WINSTA_ALL_ACCESS = (WINSTA_ENUMDESKTOPS or WINSTA_READATTRIBUTES or WINSTA_ACCESSCLIPBOARD or \
			     WINSTA_CREATEDESKTOP or WINSTA_WRITEATTRIBUTES or WINSTA_ACCESSGLOBALATOMS or \
			     WINSTA_EXITWINDOWS or WINSTA_ENUMERATE or WINSTA_READSCREEN)

CWF_CREATE_ONLY = 1
WSF_VISIBLE = 1

UOI_FLAGS = 1
UOI_NAME = 2
UOI_TYPE = 3
UOI_USER_SID = 4

struct USEROBJECTFLAGS
       fInherit dd ?
       fReserved dd ?
       dwFlags dd ?
ends

struct WNDCLASSEXA
       cbSize dd ?
       style dd ?
       lpfnWndProc dq ?
       cbClsExtra dd ?
       cbWndExtra dd ?
       hInstance dq ?
       hIcon dq ?
       hCursor dq ?
       hbrBackground dq ?
       lpszMenuName dq ?
       lpszClassName dq ?
       hIconSm dq ?
ends

struct WNDCLASSEXW
       cbSize dd ?
       style dd ?
       lpfnWndProc dq ?
       cbClsExtra dd ?
       cbWndExtra dd ?
       hInstance dq ?
       hIcon dq ?
       hCursor dq ?
       hbrBackground dq ?
       lpszMenuName dq ?
       lpszClassName dq ?
       hIconSm dq ?
ends

struct WNDCLASSA
       style dd ?,?
       lpfnWndProc dq ?
       cbClsExtra dd ?
       cbWndExtra dd ?
       hInstance dq ?
       hIcon dq ?
       hCursor dq ?
       hbrBackground dq ?
       lpszMenuName dq ?
       lpszClassName dq ?
ends

struct WNDCLASSW
       style dd ?,?
       lpfnWndProc dq ?
       cbClsExtra dd ?
       cbWndExtra dd ?
       hInstance dq ?
       hIcon dq ?
       hCursor dq ?
       hbrBackground dq ?
       lpszMenuName dq ?
       lpszClassName dq ?
ends

GWL_WNDPROC	    = -4
GWL_HINSTANCE	    = -6
GWL_HWNDPARENT	    = -8
GWL_STYLE	    = -16
GWL_EXSTYLE	    = -20
GWL_USERDATA	    = -21
GWL_ID		    = -12

GWLP_WNDPROC	    = -4
GWLP_HINSTANCE	    = -6
GWLP_HWNDPARENT     = -8
GWLP_USERDATA	    = -21
GWLP_ID 	    = -12

GCL_MENUNAME = -8
GCL_HBRBACKGROUND = -10
GCL_HCURSOR = -12
GCL_HICON = -14
GCL_HMODULE = -16
GCL_CBWNDEXTRA = -18
GCL_CBCLSEXTRA = -20
GCL_WNDPROC = -24
GCL_STYLE = -26
GCW_ATOM = -32

GCLP_MENUNAME = -8
GCLP_HBRBACKGROUND  = -10
GCLP_HCURSOR = -12
GCLP_HICON = -14
GCLP_HMODULE = -16
GCLP_WNDPROC = -24
GCLP_HICONSM = -34

WM_NULL = 0
WM_CREATE = 1
WM_DESTROY = 2
WM_MOVE = 3
WM_SIZE = 5
WM_ACTIVATE = 6
WA_INACTIVE = 0
WA_ACTIVE = 1
WA_CLICKACTIVE = 2
WM_SETFOCUS = 7
WM_KILLFOCUS = 8
WM_ENABLE = $A
WM_SETREDRAW = $B
WM_SETTEXT = $C
WM_GETTEXT = $D
WM_GETTEXTLENGTH = $E
WM_PAINT = $F
WM_CLOSE = $10
WM_QUERYENDSESSION = $11
WM_QUERYOPEN = $13
WM_ENDSESSION = $16
WM_QUIT = $12
WM_ERASEBKGND = $14
WM_SYSCOLORCHANGE  = $15
WM_SHOWWINDOW = $18
WM_WININICHANGE = $1A
WM_SETTINGCHANGE = WM_WININICHANGE
WM_DEVMODECHANGE = $1B
WM_ACTIVATEAPP = $1C
WM_FONTCHANGE = $1D
WM_TIMECHANGE = $1E
WM_CANCELMODE = $1F
WM_SETCURSOR = $20
WM_MOUSEACTIVATE = $21
WM_CHILDACTIVATE = $22
WM_QUEUESYNC = $23
WM_GETMINMAXINFO = $24

struct MINMAXINFO
       ptReserved POINT
       ptMaxSize POINT
       ptMaxPosition POINT
       ptMinTrackSize POINT
       ptMaxTrackSize POINT
ends

WM_PAINTICON = $26
WM_ICONERASEBKGND = $27
WM_NEXTDLGCTL = $28
WM_SPOOLERSTATUS = $2A
WM_DRAWITEM = $2B
WM_MEASUREITEM = $2C
WM_DELETEITEM = $2D
WM_VKEYTOITEM = $2E
WM_CHARTOITEM = $2F
WM_SETFONT = $30
WM_GETFONT = $31
WM_SETHOTKEY = $32
WM_GETHOTKEY = $33
WM_QUERYDRAGICON = $37
WM_COMPAREITEM = $39
WM_GETOBJECT = $3D
WM_COMPACTING = $41
WM_COMMNOTIFY = $44
WM_WINDOWPOSCHANGING = $46
WM_WINDOWPOSCHANGED = $47
WM_POWER = $48

PWR_OK = 1
PWR_FAIL = -1
PWR_SUSPENDREQUEST = 1
PWR_SUSPENDRESUME = 2
PWR_CRITICALRESUME = 3
WM_COPYDATA = $4A
WM_CANCELJOURNAL = $4B

struct COPYDATASTRUCT
       dwData dq ?
       cbData dd ?,?
       lpData dq ?
ends

struct MDINEXTMENU
       hmenuIn dq ?
       hmenuNext dq ?
       hwndNext dq ?
ends

WM_NOTIFY = $4E
WM_INPUTLANGCHANGEREQUEST = $50
WM_INPUTLANGCHANGE= $51
WM_TCARD = $52
WM_HELP = $53
WM_USERCHANGED = $54
WM_NOTIFYFORMAT = $55
NFR_ANSI = 1
NFR_UNICODE = 2
NF_QUERY = 3
NF_REQUERY = 4
WM_CONTEXTMENU = $7B
WM_STYLECHANGING = $7C
WM_STYLECHANGED = $7D
WM_DISPLAYCHANGE = $7E
WM_GETICON = $7F
WM_SETICON = $80
WM_NCCREATE = $81
WM_NCDESTROY = $82
WM_NCCALCSIZE = $83
WM_NCHITTEST = $84
WM_NCPAINT = $85
WM_NCACTIVATE = $86
WM_GETDLGCODE = $87
WM_SYNCPAINT = $88
WM_NCMOUSEMOVE = $A0
WM_NCLBUTTONDOWN = $A1
WM_NCLBUTTONUP = $A2
WM_NCLBUTTONDBLCLK = $A3
WM_NCRBUTTONDOWN = $A4
WM_NCRBUTTONUP = $A5
WM_NCRBUTTONDBLCLK = $A6
WM_NCMBUTTONDOWN = $A7
WM_NCMBUTTONUP = $A8
WM_NCMBUTTONDBLCLK = $A9
WM_NCXBUTTONDOWN = $AB
WM_NCXBUTTONUP = $AC
WM_NCXBUTTONDBLCLK = $AD
WM_INPUT = $FF
WM_KEYFIRST = $100
WM_KEYDOWN = $100
WM_KEYUP = $101
WM_CHAR = $102
WM_DEADCHAR = $103
WM_SYSKEYDOWN = $104
WM_SYSKEYUP = $105
WM_SYSCHAR = $106
WM_SYSDEADCHAR = $107
WM_UNICHAR = $109
WM_KEYLAST = $109
UNICODE_NOCHAR = $FFFF
WM_KEYLAST = $108
WM_IME_STARTCOMPOSITION = $10D
WM_IME_ENDCOMPOSITION = $10E
WM_IME_COMPOSITION = $10F
WM_IME_KEYLAST = $10F
WM_INITDIALOG = $110
WM_COMMAND = $111
WM_SYSCOMMAND = $112
WM_TIMER = $113
WM_HSCROLL = $114
WM_VSCROLL = $115
WM_INITMENU = $116
WM_INITMENUPOPUP = $117
WM_MENUSELECT = $11F
WM_MENUCHAR = $120
WM_ENTERIDLE = $121
WM_MENURBUTTONUP = $122
WM_MENUDRAG = $123
WM_MENUGETOBJECT = $124
WM_UNINITMENUPOPUP = $125
WM_MENUCOMMAND = $126
WM_CHANGEUISTATE = $127
WM_UPDATEUISTATE = $128
WM_QUERYUISTATE = $129

UIS_SET = 1
UIS_CLEAR = 2
UIS_INITIALIZE = 3
UISF_HIDEFOCUS = 1
UISF_HIDEACCEL = 2
UISF_ACTIVE = 4

WM_CTLCOLORMSGBOX  = $132
WM_CTLCOLOREDIT = $133
WM_CTLCOLORLISTBOX = $134
WM_CTLCOLORBTN = $135
WM_CTLCOLORDLG = $136
WM_CTLCOLORSCROLLBAR = $137
WM_CTLCOLORSTATIC = $138
MN_GETHMENU = $1E1
WM_MOUSEFIRST  = $200
WM_MOUSEMOVE = $200
WM_LBUTTONDOWN = $201
WM_LBUTTONUP = $202
WM_LBUTTONDBLCLK = $203
WM_RBUTTONDOWN = $204
WM_RBUTTONUP = $205
WM_RBUTTONDBLCLK = $206
WM_MBUTTONDOWN = $207
WM_MBUTTONUP = $208
WM_MBUTTONDBLCLK = $209
WM_MOUSEWHEEL = $20A
WM_XBUTTONDOWN = $20B
WM_XBUTTONUP = $20C
WM_XBUTTONDBLCLK = $20D
WM_MOUSELAST = $20D
WHEEL_DELTA = 120
WHEEL_PAGESCROLL = -1
XBUTTON1 = 1
XBUTTON2 = 2
WM_PARENTNOTIFY = $210
WM_ENTERMENULOOP = $211
WM_EXITMENULOOP = $212
WM_NEXTMENU = $213
WM_SIZING = $214
WM_CAPTURECHANGED = $215
WM_MOVING = $216
WM_POWERBROADCAST = $218

PBT_APMQUERYSUSPEND = 0
PBT_APMQUERYSTANDBY = 1
PBT_APMQUERYSUSPENDFAILED = 2
PBT_APMQUERYSTANDBYFAILED = 3
PBT_APMSUSPEND = 4
PBT_APMSTANDBY = 5
PBT_APMRESUMECRITICAL = 6
PBT_APMRESUMESUSPEND = 7
PBT_APMRESUMESTANDBY = 8
PBTF_APMRESUMEFROMFAILURE = 1
PBT_APMBATTERYLOW = $9
PBT_APMPOWERSTATUSCHANGE = $A
PBT_APMOEMEVENT = $B
PBT_APMRESUMEAUTOMATIC = $12

WM_DEVICECHANGE = $219
WM_MDICREATE = $220
WM_MDIDESTROY = $221
WM_MDIACTIVATE = $222
WM_MDIRESTORE = $223
WM_MDINEXT = $224
WM_MDIMAXIMIZE = $225
WM_MDITILE = $226
WM_MDICASCADE = $227
WM_MDIICONARRANGE = $228
WM_MDIGETACTIVE = $229
WM_MDISETMENU = $230
WM_ENTERSIZEMOVE = $231
WM_EXITSIZEMOVE = $232
WM_DROPFILES = $233
WM_MDIREFRESHMENU = $234
WM_IME_SETCONTEXT = $281
WM_IME_NOTIFY = $282
WM_IME_CONTROL = $283
WM_IME_COMPOSITIONFULL = $284
WM_IME_SELECT = $285
WM_IME_CHAR = $286
WM_IME_REQUEST = $288
WM_IME_KEYDOWN = $290
WM_IME_KEYUP = $291
WM_MOUSEHOVER = $2A1
WM_MOUSELEAVE = $2A3
WM_NCMOUSEHOVER = $2A0
WM_NCMOUSELEAVE = $2A2
WM_WTSSESSION_CHANGE = $2B1
WM_TABLET_FIRST = $2c0
WM_TABLET_LAST = $2df
WM_CUT = $300
WM_COPY = $301
WM_PASTE = $302
WM_CLEAR = $303
WM_UNDO = $304
WM_RENDERFORMAT = $305
WM_RENDERALLFORMATS = $306
WM_DESTROYCLIPBOARD = $307
WM_DRAWCLIPBOARD = $308
WM_PAINTCLIPBOARD = $309
WM_VSCROLLCLIPBOARD = $30A
WM_SIZECLIPBOARD = $30B
WM_ASKCBFORMATNAME = $30C
WM_CHANGECBCHAIN = $30D
WM_HSCROLLCLIPBOARD = $30E
WM_QUERYNEWPALETTE = $30F
WM_PALETTEISCHANGING = $310
WM_PALETTECHANGED = $311
WM_HOTKEY = $312
WM_PRINT = $317
WM_PRINTCLIENT = $318
WM_APPCOMMAND = $319
WM_THEMECHANGED = $31A
WM_HANDHELDFIRST = $358
WM_HANDHELDLAST = $35F
WM_AFXFIRST = $360
WM_AFXLAST = $37F
WM_PENWINFIRST = $380
WM_PENWINLAST = $38F
WM_APP = $8000
WM_USER = $400

WMSZ_LEFT = 1
WMSZ_RIGHT = 2
WMSZ_TOP = 3
WMSZ_TOPLEFT = 4
WMSZ_TOPRIGHT = 5
WMSZ_BOTTOM = 6
WMSZ_BOTTOMLEFT = 7
WMSZ_BOTTOMRIGHT = 8

HTERROR = -2
HTTRANSPARENT = -1
HTNOWHERE = 0
HTCLIENT = 1
HTCAPTION = 2
HTSYSMENU = 3
HTGROWBOX = 4
HTSIZE = HTGROWBOX
HTMENU = 5
HTHSCROLL = 6
HTVSCROLL = 7
HTMINBUTTON = 8
HTMAXBUTTON = 9
HTLEFT = 10
HTRIGHT = 11
HTTOP = 12
HTTOPLEFT = 13
HTTOPRIGHT = 14
HTBOTTOM = 15
HTBOTTOMLEFT = 16
HTBOTTOMRIGHT = 17
HTBORDER = 18
HTREDUCE = HTMINBUTTON
HTZOOM = HTMAXBUTTON
HTSIZEFIRST = HTLEFT
HTSIZELAST = HTBOTTOMRIGHT
HTOBJECT = 19
HTCLOSE = 20
HTHELP = 21

SMTO_NORMAL = 0
SMTO_BLOCK = 1
SMTO_ABORTIFHUNG = 2
SMTO_NOTIMEOUTIFNOTHUNG = 8

MA_ACTIVATE = 1
MA_ACTIVATEANDEAT = 2
MA_NOACTIVATE = 3
MA_NOACTIVATEANDEAT = 4

ICON_SMALL = 0
ICON_BIG = 1
ICON_SMALL2 = 2

SIZE_RESTORED = 0
SIZE_MINIMIZED = 1
SIZE_MAXIMIZED = 2
SIZE_MAXSHOW = 3
SIZE_MAXHIDE = 4

SIZENORMAL = SIZE_RESTORED
SIZEICONIC = SIZE_MINIMIZED
SIZEFULLSCREEN = SIZE_MAXIMIZED
SIZEZOOMSHOW = SIZE_MAXSHOW
SIZEZOOMHIDE = SIZE_MAXHIDE

struct WINDOWPOS
       hwnd dq ?
       hwndInsertAfter dq ?
       x dd ?
       y dd ?
       cx dd ?
       cy dd ?
       flags dd ?,?
ends

struct NCCALCSIZEPARAMS
       rgrc RECT
	    db 2*sizeof.RECT dup(?)
       lppos dq ?
ends

WVR_ALIGNTOP = $10
WVR_ALIGNLEFT = $20
WVR_ALIGNBOTTOM = $40
WVR_ALIGNRIGHT = $80
WVR_HREDRAW = $100
WVR_VREDRAW = $200
WVR_REDRAW = WVR_HREDRAW or WVR_VREDRAW
WVR_VALIDRECTS = $400

MK_LBUTTON = 1
MK_RBUTTON = 2
MK_SHIFT = 4
MK_CONTROL = 8
MK_MBUTTON = $10
MK_XBUTTON1 = $20
MK_XBUTTON2 = $40

TME_HOVER = 1
TME_LEAVE = 2
TME_NONCLIENT = $10
TME_QUERY = $40000000
TME_CANCEL = $80000000
HOVER_DEFAULT = $FFFFFFFF

struct TRACKMOUSEEVENT
       cbSize dd ?
       dwFlags dd ?
       hwndTrack dq ?
       dwHoverTime dd ?,?
ends

WS_OVERLAPPED = 0
WS_POPUP = $80000000
WS_CHILD = $40000000
WS_MINIMIZE = $20000000
WS_VISIBLE = $10000000
WS_DISABLED = $8000000
WS_CLIPSIBLINGS = $4000000
WS_CLIPCHILDREN = $2000000
WS_MAXIMIZE = $1000000
WS_CAPTION = $C00000
WS_BORDER = $800000
WS_DLGFRAME = $400000
WS_VSCROLL = $200000
WS_HSCROLL = $100000
WS_SYSMENU = $80000
WS_THICKFRAME = $40000
WS_GROUP = $20000
WS_TABSTOP = $10000
WS_MINIMIZEBOX = $20000
WS_MAXIMIZEBOX = $10000
WS_TILED = WS_OVERLAPPED
WS_ICONIC = WS_MINIMIZE
WS_SIZEBOX = WS_THICKFRAME
WS_TILEDWINDOW = WS_OVERLAPPEDWINDOW
WS_OVERLAPPEDWINDOW = WS_OVERLAPPED or WS_CAPTION or WS_SYSMENU or WS_THICKFRAME or\
		      WS_MINIMIZEBOX or WS_MAXIMIZEBOX
WS_POPUPWINDOW =  WS_POPUP or  WS_BORDER or WS_SYSMENU
WS_CHILDWINDOW = WS_CHILD
WS_EX_DLGMODALFRAME = 1
WS_EX_NOPARENTNOTIFY = 4
WS_EX_TOPMOST = 8
WS_EX_ACCEPTFILES = $10
WS_EX_TRANSPARENT = $20
WS_EX_MDICHILD = $40
WS_EX_TOOLWINDOW = $80
WS_EX_WINDOWEDGE = $100
WS_EX_CLIENTEDGE = $200
WS_EX_CONTEXTHELP = $400
WS_EX_RIGHT = $1000
WS_EX_LEFT = 0
WS_EX_RTLREADING = $2000
WS_EX_LTRREADING = 0
WS_EX_LEFTSCROLLBAR = $4000
WS_EX_RIGHTSCROLLBAR = 0
WS_EX_CONTROLPARENT = $10000
WS_EX_STATICEDGE = $20000
WS_EX_APPWINDOW = $40000
WS_EX_OVERLAPPEDWINDOW = WS_EX_WINDOWEDGE or WS_EX_CLIENTEDGE
WS_EX_PALETTEWINDOW = WS_EX_WINDOWEDGE or WS_EX_TOOLWINDOW or WS_EX_TOPMOST
WS_EX_LAYERED = $80000
WS_EX_NOINHERITLAYOUT = $100000
WS_EX_LAYOUTRTL = $400000
WS_EX_COMPOSITED = $2000000
WS_EX_NOACTIVATE = $8000000

CS_VREDRAW = 1
CS_HREDRAW = 2
CS_DBLCLKS = 8
CS_OWNDC = $20
CS_CLASSDC = $40
CS_PARENTDC = $80
CS_NOCLOSE = $200
CS_SAVEBITS = $800
CS_BYTEALIGNCLIENT = $1000
CS_BYTEALIGNWINDOW = $2000
CS_GLOBALCLASS = $4000
CS_IME = $10000
CS_DROPSHADOW = $20000

PRF_CHECKVISIBLE = 1
PRF_NONCLIENT = 2
PRF_CLIENT = 4
PRF_ERASEBKGND = 8
PRF_CHILDREN = 10
PRF_OWNED = 20

BDR_RAISEDOUTER = 1
BDR_SUNKENOUTER = 2
BDR_RAISEDINNER = 4
BDR_SUNKENINNER = 8

BDR_OUTER = BDR_RAISEDOUTER or BDR_SUNKENOUTER
BDR_INNER = BDR_RAISEDINNER or BDR_SUNKENINNER
BDR_RAISED = BDR_RAISEDOUTER or BDR_RAISEDINNER
BDR_SUNKEN = BDR_SUNKENOUTER or BDR_SUNKENINNER


EDGE_RAISED = BDR_RAISEDOUTER or BDR_RAISEDINNER
EDGE_SUNKEN = BDR_SUNKENOUTER or BDR_SUNKENINNER
EDGE_ETCHED = BDR_SUNKENOUTER or BDR_RAISEDINNER
EDGE_BUMP = BDR_RAISEDOUTER or BDR_SUNKENINNER

BF_LEFT = 1
BF_TOP = 2
BF_RIGHT = 4
BF_BOTTOM = 8
BF_TOPLEFT = BF_TOP or BF_LEFT
BF_TOPRIGHT = BF_TOP or BF_RIGHT
BF_BOTTOMLEFT = BF_BOTTOM or BF_LEFT
BF_BOTTOMRIGHT = BF_BOTTOM or BF_RIGHT
BF_RECT = BF_LEFT or BF_TOP or BF_RIGHT or BF_BOTTOM
BF_DIAGONAL = $10
BF_DIAGONAL_ENDTOPRIGHT = BF_DIAGONAL or BF_TOP or BF_RIGHT
BF_DIAGONAL_ENDTOPLEFT = BF_DIAGONAL or BF_TOP or BF_LEFT
BF_DIAGONAL_ENDBOTTOMLEFT = BF_DIAGONAL or BF_BOTTOM or BF_LEFT
BF_DIAGONAL_ENDBOTTOMRIGHT = BF_DIAGONAL or BF_BOTTOM or BF_RIGHT
BF_MIDDLE = $800
BF_SOFT = $1000
BF_ADJUST = $2000
BF_FLAT = $4000
BF_MONO = $8000

DFC_CAPTION = 1
DFC_MENU = 2
DFC_SCROLL = 3
DFC_BUTTON = 4
DFC_POPUPMENU = 5

DFCS_CAPTIONCLOSE = 0
DFCS_CAPTIONMIN = 1
DFCS_CAPTIONMAX = 2
DFCS_CAPTIONRESTORE = 3
DFCS_CAPTIONHELP = 4
DFCS_MENUARROW = 0
DFCS_MENUCHECK = 1
DFCS_MENUBULLET = 2
DFCS_MENUARROWRIGHT = 4
DFCS_SCROLLUP = 0
DFCS_SCROLLDOWN = 1
DFCS_SCROLLLEFT = 2
DFCS_SCROLLRIGHT = 3
DFCS_SCROLLCOMBOBOX = 5
DFCS_SCROLLSIZEGRIP = 8
DFCS_SCROLLSIZEGRIPRIGHT = $10
DFCS_BUTTONCHECK = 0
DFCS_BUTTONRADIOIMAGE = 1
DFCS_BUTTONRADIOMASK = 2
DFCS_BUTTONRADIO = 4
DFCS_BUTTON3STATE = 8
DFCS_BUTTONPUSH = $10
DFCS_INACTIVE = $100
DFCS_PUSHED = $200
DFCS_CHECKED = $400
DFCS_TRANSPARENT = $800
DFCS_HOT = $1000
DFCS_ADJUSTRECT = $2000
DFCS_FLAT = $4000
DFCS_MONO = $8000

DC_ACTIVE = 1
DC_SMALLCAP = 2
DC_ICON = 4
DC_TEXT = 8
DC_INBUTTON = $10
DC_GRADIENT = $20
DC_BUTTONS = $1000

IDANI_OPEN = 1
IDANI_CAPTION = 3

CF_TEXT = 1
CF_BITMAP = 2
CF_METAFILEPICT = 3
CF_SYLK = 4
CF_DIF = 5
CF_TIFF = 6
CF_OEMTEXT = 7
CF_DIB = 8
CF_PALETTE = 9
CF_PENDATA = 10
CF_RIFF = 11
CF_WAVE = 12
CF_UNICODETEXT = 13
CF_ENHMETAFILE = 14
CF_HDROP = 15
CF_LOCALE = 16
CF_DIBV5 = 17
CF_MAX = 18
CF_OWNERDISPLAY = $80
CF_DSPTEXT = $81
CF_DSPBITMAP = $82
CF_DSPMETAFILEPICT = $83
CF_DSPENHMETAFILE = $8E
CF_PRIVATEFIRST = $200
CF_PRIVATELAST = $2FF
CF_GDIOBJFIRST = $300
CF_GDIOBJLAST = $3FF

FVIRTKEY = TRUE
FNOINVERT = 2
FSHIFT = 4
FCONTROL = 8
FALT = $10

ODT_MENU = 1
ODT_LISTBOX = 2
ODT_COMBOBOX = 3
ODT_BUTTON = 4
ODT_STATIC = 5

ODA_DRAWENTIRE = 1
ODA_SELECT = 2
ODA_FOCUS = 4

ODS_SELECTED = 1
ODS_GRAYED = 2
ODS_DISABLED = 4
ODS_CHECKED = 8
ODS_FOCUS = $10
ODS_DEFAULT = $20
ODS_COMBOBOXEDIT = $1000
ODS_HOTLIGHT = $40
ODS_INACTIVE = $80
ODS_NOACCEL = $100
ODS_NOFOCUSRECT = $200

struct MEASUREITEMSTRUCT
       CtlType dd ?
       CtlID dd ?
       itemID dd ?
       itemWidth dd ?
       itemHeight dd ?,?
       itemData dq ?
ends

struct DRAWITEMSTRUCT
       CtlType dd ?
       CtlID dd ?
       itemID dd ?
       itemAction dd ?
       itemState dd ?,?
       hwndItem dq ?
       hDC dq ?
       rcItem RECT
       itemData dq ?
ends

struct DELETEITEMSTRUCT
       CtlType dd ?
       CtlID dd ?
       itemID dd ?,?
       hwndItem dq ?
       itemData dq ?
ends

struct COMPAREITEMSTRUCT
       CtlType dd ?
       CtlID dd ?
       hwndItem dq ?
       itemID1 dd ?,?
       itemData1 dq ?
       itemID2 dd ?,?
       itemData2 dq ?
       dwLocaleId dd ?,?
ends

PM_NOREMOVE = 0
PM_REMOVE = 1
PM_NOYIELD = 2
PM_QS_INPUT = (QS_INPUT shl 16)
PM_QS_POSTMESSAGE = (QS_POSTMESSAGE or QS_HOTKEY or QS_TIMER) shl 16
PM_QS_PAINT = (QS_PAINT shl 16)
PM_QS_SENDMESSAGE = (QS_SENDMESSAGE shl 16)

MOD_ALT = 1
MOD_CONTROL = 2
MOD_SHIFT = 4
MOD_WIN = 8
IDHOT_SNAPWINDOW = -1
IDHOT_SNAPDESKTOP = -2

ENDSESSION_LOGOFF = $80000000

EWX_LOGOFF = 0
EWX_SHUTDOWN = 1
EWX_REBOOT = 2
EWX_FORCE = 4
EWX_POWEROFF = 8
EWX_FORCEIFHUNG = $10

BSM_ALLCOMPONENTS = 0
BSM_VXDS = 1
BSM_NETDRIVER = 2
BSM_INSTALLABLEDRIVERS = 4
BSM_APPLICATIONS = 8
BSM_ALLDESKTOPS = $10

BSF_QUERY = 1
BSF_IGNORECURRENTTASK = 2
BSF_FLUSHDISK = 4
BSF_NOHANG = 8
BSF_POSTMESSAGE = $10
BSF_FORCEIFHUNG = $20
BSF_NOTIMEOUTIFNOTHUNG = $40
BSF_ALLOWSFW = $80
BSF_SENDNOTIFYMESSAGE = $100
BSF_RETURNHDESK = $200
BSF_LUID = $400

BROADCAST_QUERY_DENY = $424D5144

HWND_BROADCAST = $ffff
HWND_MESSAGE = -3

DEVICE_NOTIFY_WINDOW_HANDLE = 0
DEVICE_NOTIFY_SERVICE_HANDLE = 1
DEVICE_NOTIFY_ALL_INTERFACE_CLASSES = 4

ISMEX_NOSEND = 0
ISMEX_SEND = 1
ISMEX_NOTIFY = 2
ISMEX_CALLBACK = 4
ISMEX_REPLIED = 8

CW_USEDEFAULT = $80000000
HWND_DESKTOP = 0

struct UPDATELAYEREDWINDOWINFO
       cbSize dd ?,?
       hdcDst dq ?
       pptDst dq ?
       psize dq ?
       hdcSrc dq ?
       pptSrc dq ?
       crKey dd ?,?
       pblend dq ?
       dwFlags dd ?,?
       prcDirty dq ?
ends

PW_CLIENTONLY = 1

LWA_COLORKEY = 1
LWA_ALPHA = 2

ULW_COLORKEY = 1
ULW_ALPHA = 2
ULW_OPAQUE = 4
ULW_EX_NORESIZE = 8

struct FLASHWINFO
       cbSize dd ?,?
       hwnd dq ?
       dwFlags dd ?
       uCount dd ?
       dwTimeout dd ?,?
ends

FLASHW_STOP = 0
FLASHW_CAPTION = 1
FLASHW_TRAY = 2
FLASHW_ALL = (FLASHW_CAPTION or FLASHW_TRAY)
FLASHW_TIMER = 4
FLASHW_TIMERNOFG = $C

SWP_NOSIZE = 1
SWP_NOMOVE = 2
SWP_NOZORDER = 4
SWP_NOREDRAW = 8
SWP_NOACTIVATE = $10
SWP_FRAMECHANGED = $20
SWP_SHOWWINDOW = $40
SWP_HIDEWINDOW = $80
SWP_NOCOPYBITS = $100
SWP_NOOWNERZORDER = $200
SWP_NOSENDCHANGING = $400
SWP_DRAWFRAME = SWP_FRAMECHANGED
SWP_NOREPOSITION = SWP_NOOWNERZORDER
SWP_DEFERERASE = $2000
SWP_ASYNCWINDOWPOS = $4000

HWND_TOP = 0
HWND_BOTTOM = 1
HWND_TOPMOST = -1
HWND_NOTOPMOST = -2

struct DLGTEMPLATE
       style dd ?
       dwExtendedStyle dd ?
       cdit dw ?
       x dw ?
       y dw ?
       cx dw ?
       cy dw ?
ends

struct DLGITEMTEMPLATE
       style dd ?
       dwExtendedStyle dd ?
       x dw ?
       y dw ?
       cx dw ?
       cy dw ?
       id dw ?
ends

DLGWINDOWEXTRA = 48

KEYEVENTF_EXTENDEDKEY = 1
KEYEVENTF_KEYUP = 2
KEYEVENTF_UNICODE = 4
KEYEVENTF_SCANCODE = 8

MOUSEEVENTF_MOVE = 1
MOUSEEVENTF_LEFTDOWN = 2
MOUSEEVENTF_LEFTUP = 4
MOUSEEVENTF_RIGHTDOWN = 8
MOUSEEVENTF_RIGHTUP = $10
MOUSEEVENTF_MIDDLEDOWN = $20
MOUSEEVENTF_MIDDLEUP = $40
MOUSEEVENTF_XDOWN = $80
MOUSEEVENTF_XUP = $100
MOUSEEVENTF_WHEEL = $800
MOUSEEVENTF_VIRTUALDESK = $4000
MOUSEEVENTF_ABSOLUTE = $8000

struct MOUSEINPUT
       dx dd ?
       dy dd ?
       mouseData dd ?
       dwFlags dd ?
       time dd ?,?
       dwExtraInfo dq ?
ends

struct KEYBDINPUT
       wVk dw ?
       wScan dw ?
       dwFlags dd ?
       time dd ?,?
       dwExtraInfo dq ?
ends

struct HARDWAREINPUT
       uMsg dd ?
       wParamL dw ?
       wParamH dw ?
ends

INPUT_MOUSE = 0
INPUT_KEYBOARD = 1
INPUT_HARDWARE = 2

struct INPUT
       type dd ?,?
       union
	   mi MOUSEINPUT
	   ki KEYBDINPUT
	   hi HARDWAREINPUT
       ends
ends

struct LASTINPUTINFO
       cbSize dd ?
       dwTime dd ?
ends

MWMO_WAITALL = 1
MWMO_ALERTABLE = 2
MWMO_INPUTAVAILABLE = 4

QS_KEY = 1
QS_MOUSEMOVE = 2
QS_MOUSEBUTTON = 4
QS_POSTMESSAGE = 8
QS_TIMER = $10
QS_PAINT = $20
QS_SENDMESSAGE = $40
QS_HOTKEY = $80
QS_ALLPOSTMESSAGE = $100
QS_RAWINPUT = $400

QS_MOUSE = (QS_MOUSEMOVE or QS_MOUSEBUTTON)
QS_INPUT = (QS_MOUSE or QS_KEY or QS_RAWINPUT)
QS_ALLEVENTS = (QS_INPUT or QS_POSTMESSAGE or QS_TIMER or QS_PAINT or QS_HOTKEY)
QS_ALLINPUT = (QS_INPUT or QS_POSTMESSAGE or QS_TIMER or QS_PAINT or QS_HOTKEY or\
	       QS_SENDMESSAGE)

USER_TIMER_MAXIMUM = $7FFFFFFF
USER_TIMER_MINIMUM = $A

SM_CXSCREEN = 0
SM_CYSCREEN = 1
SM_CXVSCROLL = 2
SM_CYHSCROLL = 3
SM_CYCAPTION = 4
SM_CXBORDER = 5
SM_CYBORDER = 6
SM_CXDLGFRAME = 7
SM_CYDLGFRAME = 8
SM_CYVTHUMB = 9
SM_CXHTHUMB = 10
SM_CXICON = 11
SM_CYICON = 12
SM_CXCURSOR = 13
SM_CYCURSOR = 14
SM_CYMENU = 15
SM_CXFULLSCREEN = 16
SM_CYFULLSCREEN = 17
SM_CYKANJIWINDOW = 18
SM_MOUSEPRESENT = 19
SM_CYVSCROLL = 20
SM_CXHSCROLL = 21
SM_DEBUG = 22
SM_SWAPBUTTON = 23
SM_RESERVED1 = 24
SM_RESERVED2 = 25
SM_RESERVED3 = 26
SM_RESERVED4 = 27
SM_CXMIN = 28
SM_CYMIN = 29
SM_CXSIZE = 30
SM_CYSIZE = 31
SM_CXFRAME = 32
SM_CYFRAME = 33
SM_CXMINTRACK = 34
SM_CYMINTRACK = 35
SM_CXDOUBLECLK = 36
SM_CYDOUBLECLK = 37
SM_CXICONSPACING = 38
SM_CYICONSPACING = 39
SM_MENUDROPALIGNMENT = 40
SM_PENWINDOWS = 41
SM_DBCSENABLED = 42
SM_CMOUSEBUTTONS = 43
SM_CXFIXEDFRAME = SM_CXDLGFRAME
SM_CYFIXEDFRAME = SM_CYDLGFRAME
SM_CXSIZEFRAME = SM_CXFRAME
SM_CYSIZEFRAME = SM_CYFRAME
SM_SECURE = 44
SM_CXEDGE = 45
SM_CYEDGE = 46
SM_CXMINSPACING = 47
SM_CYMINSPACING = 48
SM_CXSMICON = 49
SM_CYSMICON = 50
SM_CYSMCAPTION = 51
SM_CXSMSIZE = 52
SM_CYSMSIZE = 53
SM_CXMENUSIZE = 54
SM_CYMENUSIZE = 55
SM_ARRANGE = 56
SM_CXMINIMIZED = 57
SM_CYMINIMIZED = 58
SM_CXMAXTRACK = 59
SM_CYMAXTRACK = 60
SM_CXMAXIMIZED = 61
SM_CYMAXIMIZED = 62
SM_NETWORK = 63
SM_CLEANBOOT = 67
SM_CXDRAG = 68
SM_CYDRAG = 69
SM_SHOWSOUNDS = 70
SM_CXMENUCHECK = 71
SM_CYMENUCHECK = 72
SM_SLOWMACHINE = 73
SM_MIDEASTENABLED = 74
SM_MOUSEWHEELPRESENT = 75
SM_XVIRTUALSCREEN = 76
SM_YVIRTUALSCREEN = 77
SM_CXVIRTUALSCREEN = 78
SM_CYVIRTUALSCREEN = 79
SM_CMONITORS = 80
SM_SAMEDISPLAYFORMAT = 81
SM_IMMENABLED = 82
SM_CXFOCUSBORDER = 83
SM_CYFOCUSBORDER = 84
SM_TABLETPC = 86
SM_MEDIACENTER = 87
SM_STARTER = 88
SM_SERVERR2 = 89
SM_CMETRICS = 90
SM_REMOTESESSION = $1000
SM_SHUTTINGDOWN = $2000
SM_REMOTECONTROL = $2001
SM_CARETBLINKINGENABLED = $2002

PMB_ACTIVE = 1

MNC_IGNORE = 0
MNC_CLOSE = 1
MNC_EXECUTE = 2
MNC_SELECT = 3

struct TPMPARAMS
       cbSize dd ?
       rcExclude RECT
ends

MNS_NOCHECK = $80000000
MNS_MODELESS = $40000000
MNS_DRAGDROP = $20000000
MNS_AUTODISMISS = $10000000
MNS_NOTIFYBYPOS = $8000000
MNS_CHECKORBMP = $4000000

MIM_MAXHEIGHT = 1
MIM_BACKGROUND = 2
MIM_HELPID = 4
MIM_MENUDATA = 8
MIM_STYLE = $10
MIM_APPLYTOSUBMENUS = $80000000

struct MENUINFO
       cbSize dd ?
       fMask dd ?
       dwStyle dd ?
       cyMax dd ?
       hbrBack dq ?
       dwContextHelpID dd ?,?
       dwMenuData dq ?
ends

MND_CONTINUE = 0
MND_ENDMENU = 1

struct MENUGETOBJECTINFO
       dwFlags dd ?
       uPos dd ?
       hmenu dq ?
       riid dq ?
       pvObj dq ?
ends

MNGOF_TOPGAP = 1
MNGOF_BOTTOMGAP = 2

MNGO_NOINTERFACE = 0
MNGO_NOERROR = 1

MIIM_STATE = 1
MIIM_ID = 2
MIIM_SUBMENU = 4
MIIM_CHECKMARKS  = 8
MIIM_TYPE = $10
MIIM_DATA = $20

MIIM_STRING = $40
MIIM_BITMAP = $80
MIIM_FTYPE = $100

HBMMENU_CALLBACK = -1
HBMMENU_SYSTEM = 1
HBMMENU_MBAR_RESTORE  = 2
HBMMENU_MBAR_MINIMIZE = 3
HBMMENU_MBAR_CLOSE = 5
HBMMENU_MBAR_CLOSE_D = 6
HBMMENU_MBAR_MINIMIZE_D = 7
HBMMENU_POPUP_CLOSE = 8
HBMMENU_POPUP_RESTORE = 9
HBMMENU_POPUP_MAXIMIZE = 10
HBMMENU_POPUP_MINIMIZE = 11

struct MENUITEMINFOA
       cbSize dd ?
       fMask dd ?
       fType dd ?
       fState dd ?
       wID dd ?,?
       hSubMenu dq ?
       hbmpChecked dq ?
       hbmpUnchecked dq ?
       dwItemData dq ?
       dwTypeData dd ?
       cch dd ?,?
       hbmpItem dq ?
       pad1 dd ?
ends

struct MENUITEMINFOW
       cbSize dd ?
       fMask dd ?
       fType dd ?
       fState dd ?
       wID dd ?,?
       hSubMenu dq ?
       hbmpChecked dq ?
       hbmpUnchecked dq ?
       dwItemData dq ?
       dwTypeData dd ?
       cch dd ?,?
       hbmpItem dq ?
       pad1 dd ?
ends

GMDI_USEDISABLED = 1
GMDI_GOINTOPOPUPS = 2

TPM_LEFTBUTTON = 0
TPM_RIGHTBUTTON = 2
TPM_LEFTALIGN = 0
TPM_CENTERALIGN = 4
TPM_RIGHTALIGN = 8
TPM_TOPALIGN = 0
TPM_VCENTERALIGN = $10
TPM_BOTTOMALIGN = $20
TPM_HORIZONTAL = 0
TPM_VERTICAL = $40
TPM_NONOTIFY = $80
TPM_RETURNCMD = $100
TPM_RECURSE = 1
TPM_HORPOSANIMATION = $400
TPM_HORNEGANIMATION = $800
TPM_VERPOSANIMATION = $1000
TPM_VERNEGANIMATION = $2000
TPM_NOANIMATION = $4000
TPM_LAYOUTRTL = $8000

struct DROPSTRUCT
       hwndSource dq ?
       hwndSink dq ?
       wFmt dd ?,?
       dwData dq ?
       ptDrop POINT
       dwControlData dd ?,?
ends

DOF_EXECUTABLE = $8001
DOF_DOCUMENT = $8002
DOF_DIRECTORY = $8003
DOF_MULTIPLE = $8004
DOF_PROGMAN = 1
DOF_SHELLDATA = 2

DO_DROPFILE = $454C4946
DO_PRINTFILE = $544E5250

DT_TOP = 0
DT_LEFT = 0
DT_CENTER = 1
DT_RIGHT = 2
DT_VCENTER = 4
DT_BOTTOM = 8
DT_WORDBREAK  = $10
DT_SINGLELINE = $20
DT_EXPANDTABS = $40
DT_TABSTOP = $80
DT_NOCLIP = $100
DT_EXTERNALLEADING = $200
DT_CALCRECT = $400
DT_NOPREFIX = $800
DT_INTERNAL = $1000
DT_EDITCONTROL = $2000
DT_PATH_ELLIPSIS = $4000
DT_END_ELLIPSIS = $8000
DT_MODIFYSTRING = $10000
DT_RTLREADING = $20000
DT_WORD_ELLIPSIS = $40000
DT_NOFULLWIDTHCHARBREAK = $80000
DT_HIDEPREFIX = $100000
DT_PREFIXONLY = $200000

struct DRAWTEXTPARAMS
       cbSize dd ?
       iTabLength dd ?
       iLeftMargin dd ?
       iRightMargin dd ?
       uiLengthDrawn dd ?
ends

DST_COMPLEX = 0
DST_TEXT = 1
DST_PREFIXTEXT	= 2
DST_ICON = 3
DST_BITMAP = 4
DSS_NORMAL = 0
DSS_UNION = $10
DSS_DISABLED = $20
DSS_MONO = $80
DSS_HIDEPREFIX = $200
DSS_PREFIXONLY = $400
DSS_RIGHT = $8000

ASFW_ANY = -1

LSFW_LOCK = 1
LSFW_UNLOCK = 2

DCX_WINDOW = 1
DCX_CACHE = 2
DCX_NORESETATTRS = 4
DCX_CLIPCHILDREN = 8
DCX_CLIPSIBLINGS = $10
DCX_PARENTCLIP = $20
DCX_EXCLUDERGN = $40
DCX_INTERSECTRGN = $80
DCX_EXCLUDEUPDATE = $100
DCX_INTERSECTUPDATE = $200
DCX_LOCKWINDOWUPDATE = $400
DCX_VALIDATE = $200000

RDW_INVALIDATE = 1
RDW_INTERNALPAINT = 2
RDW_ERASE = 4
RDW_VALIDATE = 8
RDW_NOINTERNALPAINT = $10
RDW_NOERASE = $20
RDW_NOCHILDREN = $40
RDW_ALLCHILDREN = $80
RDW_UPDATENOW = $100
RDW_ERASENOW  = $200
RDW_FRAME = $400
RDW_NOFRAME = $800

SW_SCROLLCHILDREN = 1
SW_INVALIDATE = 2
SW_ERASE = 4
SW_SMOOTHSCROLL = $10

ESB_ENABLE_BOTH = 0
ESB_DISABLE_BOTH = 3
ESB_DISABLE_LEFT = 1
ESB_DISABLE_RIGHT = 2
ESB_DISABLE_UP = 1
ESB_DISABLE_DOWN = 2
ESB_DISABLE_LTUP = ESB_DISABLE_LEFT
ESB_DISABLE_RTDN = ESB_DISABLE_RIGHT

HELPINFO_WINDOW = 1
HELPINFO_MENUITEM = 2

struct HELPINFO
       cbSize dd ?
       iContextType dd ?
       iCtrlId dd ?,?
       hItemHandle dq ?
       dwContextId dq ?
       MousePos dd ?,?
ends

MB_OK = 0
MB_OKCANCEL = 1
MB_ABORTRETRYIGNORE = 2
MB_YESNOCANCEL = 3
MB_YESNO = 4
MB_RETRYCANCEL = 5
MB_CANCELTRYCONTINUE = 6
MB_ICONHAND = $10
MB_ICONQUESTION = $20
MB_ICONEXCLAMATION = $30
MB_ICONASTERISK = $40
MB_USERICON = $80
MB_ICONWARNING = MB_ICONEXCLAMATION
MB_ICONERROR = MB_ICONHAND
MB_ICONINFORMATION = MB_ICONASTERISK
MB_ICONSTOP = MB_ICONHAND
MB_DEFBUTTON1 = 0
MB_DEFBUTTON2 = $100
MB_DEFBUTTON3 = $200
MB_DEFBUTTON4 = $300
MB_APPLMODAL = 0
MB_SYSTEMMODAL = $1000
MB_TASKMODAL = $2000
MB_HELP = $4000
MB_NOFOCUS = $8000
MB_SETFOREGROUND = $10000
MB_DEFAULT_DESKTOP_ONLY = $20000
MB_TOPMOST = $40000
MB_RIGHT = $80000
MB_RTLREADING = $100000
MB_SERVICE_NOTIFICATION = $200000
MB_SERVICE_NOTIFICATION_NT3X = $40000
MB_TYPEMASK = $F
MB_ICONMASK = $F0
MB_DEFMASK = $F00
MB_MODEMASK = $3000
MB_MISCMASK = $C000
MB_PRECOMPOSED = 1
MB_COMPOSITE = 2
MB_USEGLYPHCHARS = 4
MB_ERR_INVALID_CHARS = 8
WC_COMPOSITECHECK = $200
WC_DISCARDNS = $10
WC_SEPCHARS = $20
WC_DEFAULTCHAR = $40

struct MSGBOXPARAMSA
       cbSize dd ?,?
       hwndOwner dq ?
       hInstance dq ?
       lpszText dq ?
       lpszCaption dq ?
       dwStyle dd ?,?
       lpszIcon dq ?
       dwContextHelpId dd ?,?
       lpfnMsgBoxCallback dq ?
       dwLanguageId dd ?,?
ends

struct MSGBOXPARAMSW
       cbSize dd ?,?
       hwndOwner dq ?
       hInstance dq ?
       lpszText dq ?
       lpszCaption dq ?
       dwStyle dd ?,?
       lpszIcon dq ?
       dwContextHelpId dd ?,?
       lpfnMsgBoxCallback dq ?
       dwLanguageId dd ?,?
ends

CWP_ALL = 0
CWP_SKIPINVISIBLE = 1
CWP_SKIPDISABLED = 2
CWP_SKIPTRANSPARENT = 4

CTLCOLOR_MSGBOX = 0
CTLCOLOR_EDIT = 1
CTLCOLOR_LISTBOX = 2
CTLCOLOR_BTN = 3
CTLCOLOR_DLG = 4
CTLCOLOR_SCROLLBAR = 5
CTLCOLOR_STATIC = 6
CTLCOLOR_MAX = 7

COLOR_SCROLLBAR = 0
COLOR_BACKGROUND = 1
COLOR_ACTIVECAPTION = 2
COLOR_INACTIVECAPTION = 3
COLOR_MENU = 4
COLOR_WINDOW = 5
COLOR_WINDOWFRAME = 6
COLOR_MENUTEXT = 7
COLOR_WINDOWTEXT = 8
COLOR_CAPTIONTEXT = 9
COLOR_ACTIVEBORDER = 10
COLOR_INACTIVEBORDER = 11
COLOR_APPWORKSPACE = 12
COLOR_HIGHLIGHT = 13
COLOR_HIGHLIGHTTEXT = 14
COLOR_BTNFACE = 15
COLOR_BTNSHADOW = 16
COLOR_GRAYTEXT = 17
COLOR_BTNTEXT = 18
COLOR_INACTIVECAPTIONTEXT = 19
COLOR_BTNHIGHLIGHT = 20
COLOR_3DDKSHADOW = 21
COLOR_3DLIGHT = 22
COLOR_INFOTEXT = 23
COLOR_INFOBK = 24
COLOR_HOTLIGHT = 26
COLOR_GRADIENTACTIVECAPTION = 27
COLOR_GRADIENTINACTIVECAPTION = 28
COLOR_MENUHILIGHT = 29
COLOR_MENUBAR = 30
COLOR_DESKTOP = COLOR_BACKGROUND
COLOR_3DFACE = COLOR_BTNFACE
COLOR_3DSHADOW = COLOR_BTNSHADOW
COLOR_3DHIGHLIGHT = COLOR_BTNHIGHLIGHT
COLOR_3DHILIGHT = COLOR_BTNHIGHLIGHT
COLOR_BTNHILIGHT = COLOR_BTNHIGHLIGHT

GW_HWNDFIRST = 0
GW_HWNDLAST = 1
GW_HWNDNEXT = 2
GW_HWNDPREV = 3
GW_OWNER = 4
GW_CHILD = 5
GW_ENABLEDPOPUP = 6
GW_MAX = 6

MF_INSERT = 0
MF_CHANGE = $80
MF_APPEND = $100
MF_DELETE = $200
MF_REMOVE = $1000
MF_BYCOMMAND = 0
MF_BYPOSITION = $400
MF_SEPARATOR = $800
MF_ENABLED = 0
MF_GRAYED = 1
MF_DISABLED = 2
MF_UNCHECKED = 0
MF_CHECKED = 8
MF_USECHECKBITMAPS  = $200
MF_STRING = 0
MF_BITMAP = 4
MF_OWNERDRAW = $100
MF_POPUP = $10
MF_MENUBARBREAK = $20
MF_MENUBREAK = $40
MF_UNHILITE = 0
MF_HILITE = $80
MF_DEFAULT = $1000
MF_SYSMENU = $2000
MF_HELP = $4000
MF_RIGHTJUSTIFY = $4000
MF_MOUSESELECT = $8000
MF_END = $80
MFR_POPUP = 1
MFR_END = MF_END

MFT_STRING = MF_STRING
MFT_BITMAP = MF_BITMAP
MFT_MENUBARBREAK = MF_MENUBARBREAK
MFT_MENUBREAK = MF_MENUBREAK
MFT_OWNERDRAW = MF_OWNERDRAW
MFT_RADIOCHECK = $200
MFT_SEPARATOR = MF_SEPARATOR
MFT_RIGHTORDER = $2000
MFT_RIGHTJUSTIFY = MF_RIGHTJUSTIFY

MFS_GRAYED = 3
MFS_DISABLED = MFS_GRAYED
MFS_CHECKED = MF_CHECKED
MFS_HILITE = MF_HILITE
MFS_ENABLED = MF_ENABLED
MFS_UNCHECKED = MF_UNCHECKED
MFS_UNHILITE = MF_UNHILITE
MFS_DEFAULT = MF_DEFAULT

SC_SIZE = $F000
SC_MOVE = $F010
SC_MINIMIZE = $F020
SC_MAXIMIZE = $F030
SC_NEXTWINDOW = $F040
SC_PREVWINDOW = $F050
SC_CLOSE = $F060
SC_VSCROLL = $F070
SC_HSCROLL = $F080
SC_MOUSEMENU = $F090
SC_KEYMENU = $F100
SC_ARRANGE = $F110
SC_RESTORE = $F120
SC_TASKLIST = $F130
SC_SCREENSAVE = $F140
SC_HOTKEY = $F150
SC_DEFAULT = $F160
SC_MONITORPOWER = $F170
SC_CONTEXTHELP = $F180
SC_SEPARATOR = $F00F
SC_ICON = SC_MINIMIZE
SC_ZOOM = SC_MAXIMIZE

IDC_ARROW = 32512
IDC_IBEAM = 32513
IDC_WAIT = 32514
IDC_CROSS = 32515
IDC_UPARROW = 32516
IDC_SIZE = 32640
IDC_ICON = 32641
IDC_SIZENWSE = 32642
IDC_SIZENESW = 32643
IDC_SIZEWE = 32644
IDC_SIZENS = 32645
IDC_SIZEALL  = 32646
IDC_NO = 32648
IDC_HAND = 32649
IDC_APPSTARTING = 32650
IDC_HELP = 32651

IDC_STATIC = -1
IDC_EDIT1 = 3000
IDC_EDIT2 = 3001
IDC_BUTTON1 = 3002
IDC_BUTTON2 = 3003
IDC_USER1 = 3000

struct MENUITEMTEMPLATEHEADER
       versionNumber dw ?
       offset dw ?
ends

struct MENUITEMTEMPLATE
       mtOption dw ?
       mtID dw ?
       mtString dw ?
ends

struct ICONINFO
       fIcon dd ?
       xHotspot dd ?
       yHotspot dd ?,?
       hbmMask dq ?
       hbmColor dq ?
ends

struct ICONINFOEXA
       cbSize dd ?
       fIcon dd ?
       xHotspot dd ?
       yHotspot dd ?
       hbmMask dq ?
       hbmColor dq ?
       wResID dw ?
       szModName db MAX_PATH dup(?)
       szResName db MAX_PATH+6 dup(?)
ends

struct ICONINFOEXW
       cbSize dd ?
       fIcon dd ?
       xHotspot dd ?
       yHotspot dd ?
       hbmMask dq ?
       hbmColor dq ?
       wResID dw ?
       szModName du MAX_PATH dup(?)
       szResName du MAX_PATH+3 dup(?)
ends

struct CURSORSHAPE
       xHotSpot dd ?
       yHotSpot dd ?
       cx dd ?
       cy dd ?
       cbWidth dd ?
       Planes db ?
       BitsPixel db ?
ends

IMAGE_BITMAP = 0
IMAGE_ICON = 1
IMAGE_CURSOR = 2
IMAGE_ENHMETAFILE = 3

LR_DEFAULTCOLOR = 0
LR_MONOCHROME = 1
LR_COLOR = 2
LR_COPYRETURNORG = 4
LR_COPYDELETEORG = 8
LR_LOADFROMFILE = $10
LR_LOADTRANSPARENT = $20
LR_DEFAULTSIZE = $40
LR_VGACOLOR = $80
LR_LOADMAP3DCOLORS = $1000
LR_CREATEDIBSECTION = $2000
LR_COPYFROMRESOURCE = $4000
LR_SHARED = $8000

DI_MASK = 1
DI_IMAGE = 2
DI_NORMAL = 3
DI_COMPAT = 4
DI_DEFAULTSIZE = 8
DI_NOMIRROR = $10

RES_ICON = 1
RES_CURSOR = 2

OBM_CLOSE = 32754
OBM_UPARROW = 32753
OBM_DNARROW = 32752
OBM_RGARROW = 32751
OBM_LFARROW = 32750
OBM_REDUCE = 32749
OBM_ZOOM = 32748
OBM_RESTORE = 32747
OBM_REDUCED = 32746
OBM_ZOOMD = 32745
OBM_RESTORED = 32744
OBM_UPARROWD = 32743
OBM_DNARROWD = 32742
OBM_RGARROWD = 32741
OBM_LFARROWD = 32740
OBM_MNARROW = 32739
OBM_COMBO = 32738
OBM_UPARROWI = 32737
OBM_DNARROWI = 32736
OBM_RGARROWI = 32735
OBM_LFARROWI = 32734
OBM_OLD_CLOSE = 32767
OBM_SIZE = 32766
OBM_OLD_UPARROW = 32765
OBM_OLD_DNARROW = 32764
OBM_OLD_RGARROW = 32763
OBM_OLD_LFARROW = 32762
OBM_BTSIZE = 32761
OBM_CHECK = 32760
OBM_CHECKBOXES = 32759
OBM_BTNCORNERS = 32758
OBM_OLD_REDUCE = 32757
OBM_OLD_ZOOM = 32756
OBM_OLD_RESTORE = 32755

OCR_NORMAL = 32512
OCR_IBEAM = 32513
OCR_WAIT = 32514
OCR_CROSS = 32515
OCR_UP = 32516
OCR_SIZE = 32640
OCR_ICON = 32641
OCR_SIZENWSE = 32642
OCR_SIZENESW = 32643
OCR_SIZEWE = 32644
OCR_SIZENS = 32645
OCR_SIZEALL = 32646
OCR_ICOCUR = 32647
OCR_NO = 32648
OCR_HAND = 32649
OCR_APPSTARTING = 32650

OIC_SAMPLE = 32512
OIC_HAND = 32513
OIC_QUES = 32514
OIC_BANG = 32515
OIC_NOTE = 32516
OIC_WINLOGO = 32517
OIC_WARNING = OIC_BANG
OIC_ERROR = OIC_HAND
OIC_INFORMATION = OIC_NOTE

ORD_LANGDRIVER = 1

IDI_APPLICATION = 32512
IDI_HAND = 32513
IDI_QUESTION = 32514
IDI_EXCLAMATION = 32515
IDI_ASTERISK = 32516
IDI_WINLOGO = 32517
IDI_WARNING = IDI_EXCLAMATION
IDI_ERROR = IDI_HAND
IDI_INFORMATION = IDI_ASTERISK

IDOK = 1
IDCANCEL = 2
IDABORT = 3
IDRETRY = 4
IDIGNORE = 5
IDYES = 6
IDNO = 7
IDCLOSE = 8
IDHELP = 9
IDTRYAGAIN = 10
IDCONTINUE = 11
IDTIMEOUT  = 32000

ES_LEFT = 0
ES_CENTER = 1
ES_RIGHT = 2
ES_MULTILINE = 4
ES_UPPERCASE = 8
ES_LOWERCASE = $10
ES_PASSWORD = $20
ES_AUTOVSCROLL = $40
ES_AUTOHSCROLL = $80
ES_NOHIDESEL = $100
ES_OEMCONVERT = $400
ES_READONLY = $800
ES_WANTRETURN = $1000
ES_NUMBER = $2000

EN_SETFOCUS = $100
EN_KILLFOCUS = $200
EN_CHANGE = $300
EN_UPDATE = $400
EN_ERRSPACE = $500
EN_MAXTEXT = $501
EN_HSCROLL = $601
EN_VSCROLL = $602
EN_ALIGN_LTR_EC = $700
EN_ALIGN_RTL_EC = $701

EC_LEFTMARGIN = 1
EC_RIGHTMARGIN = 2
EC_USEFONTINFO = $ffff

EMSIS_COMPOSITIONSTRING = 1

EIMES_GETCOMPSTRATONCE = 1
EIMES_CANCELCOMPSTRINFOCUS = 2
EIMES_COMPLETECOMPSTRKILLFOCUS = 4

EM_GETSEL = $B0
EM_SETSEL = $B1
EM_GETRECT = $B2
EM_SETRECT = $B3
EM_SETRECTNP = $B4
EM_SCROLL = $B5
EM_LINESCROLL = $B6
EM_SCROLLCARET = $B7
EM_GETMODIFY = $B8
EM_SETMODIFY = $B9
EM_GETLINECOUNT = $BA
EM_LINEINDEX = $BB
EM_SETHANDLE = $BC
EM_GETHANDLE = $BD
EM_GETTHUMB = $BE
EM_LINELENGTH = $C1
EM_REPLACESEL = $C2
EM_GETLINE = $C4
EM_LIMITTEXT = $C5
EM_CANUNDO = $C6
EM_UNDO = $C7
EM_FMTLINES = $C8
EM_LINEFROMCHAR = $C9
EM_SETTABSTOPS = $CB
EM_SETPASSWORDCHAR = $CC
EM_EMPTYUNDOBUFFER = $CD
EM_GETFIRSTVISIBLELINE = $CE
EM_SETREADONLY = $CF
EM_SETWORDBREAKPROC = $D0
EM_GETWORDBREAKPROC = $D1
EM_GETPASSWORDCHAR = $D2
EM_SETMARGINS = $D3
EM_GETMARGINS = $D4
EM_SETLIMITTEXT = EM_LIMITTEXT
EM_GETLIMITTEXT = $D5
EM_POSFROMCHAR = $D6
EM_CHARFROMPOS = $D7
EM_SETIMESTATUS = $D8
EM_GETIMESTATUS = $D9

WB_LEFT = 0
WB_RIGHT = 1
WB_ISDELIMITER = 2

BS_PUSHBUTTON = 0
BS_DEFPUSHBUTTON = 1
BS_CHECKBOX = 2
BS_AUTOCHECKBOX = 3
BS_RADIOBUTTON = 4
BS_3STATE = 5
BS_AUTO3STATE = 6
BS_GROUPBOX = 7
BS_USERBUTTON = 8
BS_AUTORADIOBUTTON  = 9
BS_PUSHBOX = $A
BS_OWNERDRAW = $B
BS_TYPEMASK = $F
BS_LEFTTEXT = $20
BS_TEXT = 0
BS_ICON = $40
BS_BITMAP = $80
BS_LEFT = $100
BS_RIGHT = $200
BS_CENTER = $300
BS_TOP = $400
BS_BOTTOM = $800
BS_VCENTER = $C00
BS_PUSHLIKE = $1000
BS_MULTILINE = $2000
BS_NOTIFY = $4000
BS_FLAT = $8000
BS_RIGHTBUTTON = BS_LEFTTEXT

BN_CLICKED = 0
BN_PAINT = 1
BN_HILITE = 2
BN_UNHILITE = 3
BN_DISABLE = 4
BN_DOUBLECLICKED = 5
BN_PUSHED = BN_HILITE
BN_UNPUSHED = BN_UNHILITE
BN_DBLCLK = BN_DOUBLECLICKED
BN_SETFOCUS = 6
BN_KILLFOCUS = 7

BM_GETCHECK = $F0
BM_SETCHECK = $F1
BM_GETSTATE = $F2
BM_SETSTATE = $F3
BM_SETSTYLE = $F4
BM_CLICK = $F5
BM_GETIMAGE = $F6
BM_SETIMAGE = $F7

BST_UNCHECKED = 0
BST_CHECKED = 1
BST_INDETERMINATE  = 2
BST_PUSHED = 4
BST_FOCUS = 8

SS_LEFT = 0
SS_CENTER = 1
SS_RIGHT = 2
SS_ICON = 3
SS_BLACKRECT = 4
SS_GRAYRECT = 5
SS_WHITERECT = 6
SS_BLACKFRAME = 7
SS_GRAYFRAME = 8
SS_WHITEFRAME = 9
SS_USERITEM = $A
SS_SIMPLE = $B
SS_LEFTNOWORDWRAP = $C
SS_OWNERDRAW = $D
SS_BITMAP = $E
SS_ENHMETAFILE = $F
SS_ETCHEDHORZ = $10
SS_ETCHEDVERT = $11
SS_ETCHEDFRAME = $12
SS_TYPEMASK = $1F
SS_REALSIZECONTROL = $40
SS_NOPREFIX = $80
SS_NOTIFY = $100
SS_CENTERIMAGE = $200
SS_RIGHTJUST = $400
SS_REALSIZEIMAGE = $800
SS_SUNKEN = $1000
SS_EDITCONTROL = $2000
SS_ENDELLIPSIS = $4000
SS_PATHELLIPSIS = $8000
SS_WORDELLIPSIS = $C000
SS_ELLIPSISMASK = $C000

STM_SETICON = $170
STM_GETICON = $171
STM_SETIMAGE = $172
STM_GETIMAGE = $173
STN_CLICKED = 0
STN_DBLCLK = 1
STN_ENABLE = 2
STN_DISABLE = 3
STM_MSGMAX = $174

WC_DIALOG = $8002

DWL_MSGRESULT = 0
DWL_DLGPROC = 4
DWL_USER = 8

DDL_READWRITE = 0
DDL_READONLY = 1
DDL_HIDDEN = 2
DDL_SYSTEM = 4
DDL_DIRECTORY = $10
DDL_ARCHIVE = $20
DDL_POSTMSGS = $2000
DDL_DRIVES = $4000
DDL_EXCLUSIVE = $8000

DS_ABSALIGN = 1
DS_SYSMODAL = 2
DS_LOCALEDIT = $20
DS_SETFONT = $40
DS_MODALFRAME = $80
DS_NOIDLEMSG = $100
DS_SETFOREGROUND    = $200
DS_3DLOOK = 4
DS_FIXEDSYS = 8
DS_NOFAILCREATE = $10
DS_CONTROL = $400
DS_CENTER = $800
DS_CENTERMOUSE = $1000
DS_CONTEXTHELP = $2000
DS_SHELLFONT = DS_SETFONT or DS_FIXEDSYS
DS_USEPIXELS = $8000

DM_GETDEFID = WM_USER+0
DM_SETDEFID = WM_USER+1
DM_REPOSITION = WM_USER+2

SB_SETTEXTA	  = WM_USER + 1
SB_GETTEXTA	  = WM_USER + 2
SB_GETTEXTLENGTHA = WM_USER + 3
SB_SETPARTS	  = WM_USER + 4
SB_GETPARTS	  = WM_USER + 6
SB_GETBORDERS	  = WM_USER + 7
SB_SETMINHEIGHT   = WM_USER + 8
SB_SIMPLE	  = WM_USER + 9
SB_GETRECT	  = WM_USER + 10
SB_SETTEXTW	  = WM_USER + 11
SB_GETTEXTW	  = WM_USER + 13
SB_GETTEXTLENGTHW = WM_USER + 12
if sizeof.TCHAR = 1
    SB_SETTEXT	  = SB_SETTEXTA
else
    SB_SETTEXT	  = SB_SETTEXTW
end if
if sizeof.TCHAR = 1
    SB_GETTEXT	  = SB_GETTEXTA
else
    SB_GETTEXT	  = SB_GETTEXTW
end if
if sizeof.TCHAR = 1
    SB_GETTEXTLENGTH  = SB_GETTEXTLENGTHA
else
    SB_GETTEXTLENGTH  = SB_GETTEXTLENGTHW
end if

DC_HASDEFID = $534B

DLGC_WANTARROWS = 1
DLGC_WANTTAB = 2
DLGC_WANTALLKEYS = 4
DLGC_WANTMESSAGE = 4
DLGC_HASSETSEL = 8
DLGC_DEFPUSHBUTTON = $10
DLGC_UNDEFPUSHBUTTON = $20
DLGC_RADIOBUTTON = $40
DLGC_WANTCHARS = $80
DLGC_STATIC = $100
DLGC_BUTTON = $2000

LB_CTLCODE = 0
LB_OKAY = 0
LB_ERR = -1
LB_ERRSPACE = -2

LBN_ERRSPACE = -2
LBN_SELCHANGE = 1
LBN_DBLCLK = 2
LBN_SELCANCEL = 3
LBN_SETFOCUS = 4
LBN_KILLFOCUS = 5

LB_ADDSTRING = $180
LB_INSERTSTRING = $181
LB_DELETESTRING = $182
LB_SELITEMRANGEEX = $183
LB_RESETCONTENT = $184
LB_SETSEL = $185
LB_SETCURSEL = $186
LB_GETSEL = $187
LB_GETCURSEL = $188
LB_GETTEXT = $189
LB_GETTEXTLEN = $18A
LB_GETCOUNT = $18B
LB_SELECTSTRING = $18C
LB_DIR = $18D
LB_GETTOPINDEX = $18E
LB_FINDSTRING = $18F
LB_GETSELCOUNT = $190
LB_GETSELITEMS = $191
LB_SETTABSTOPS = $192
LB_GETHORIZONTALEXTENT = $193
LB_SETHORIZONTALEXTENT = $194
LB_SETCOLUMNWIDTH = $195
LB_ADDFILE = $196
LB_SETTOPINDEX = $197
LB_GETITEMRECT = $198
LB_GETITEMDATA = $199
LB_SETITEMDATA = $19A
LB_SELITEMRANGE = $19B
LB_SETANCHORINDEX = $19C
LB_GETANCHORINDEX = $19D
LB_SETCARETINDEX = $19E
LB_GETCARETINDEX = $19F
LB_SETITEMHEIGHT = $1A0
LB_GETITEMHEIGHT = $1A1
LB_FINDSTRINGEXACT = $1A2
LB_SETLOCALE = $1A5
LB_GETLOCALE = $1A6
LB_SETCOUNT = $1A7
LB_INITSTORAGE = $1A8
LB_ITEMFROMPOINT = $1A9
LB_MULTIPLEADDSTRING = $1B1
LB_GETLISTBOXINFO = $1B2
LB_MSGMAX = $1B3

LBS_NOTIFY = 1
LBS_SORT = 2
LBS_NOREDRAW = 4
LBS_MULTIPLESEL = 8
LBS_OWNERDRAWFIXED = $10
LBS_OWNERDRAWVARIABLE = $20
LBS_HASSTRINGS = $40
LBS_USETABSTOPS = $80
LBS_NOINTEGRALHEIGHT  = $100
LBS_MULTICOLUMN = $200
LBS_WANTKEYBOARDINPUT = $400
LBS_EXTENDEDSEL = $800
LBS_DISABLENOSCROLL = $1000
LBS_NODATA = $2000
LBS_NOSEL = $4000
LBS_COMBOBOX = $8000
LBS_STANDARD = (LBS_NOTIFY or LBS_SORT or WS_VSCROLL or WS_BORDER)

CB_OKAY = 0
CB_ERR = -1
CB_ERRSPACE = -2

CBN_ERRSPACE = -1
CBN_SELCHANGE = 1
CBN_DBLCLK = 2
CBN_SETFOCUS = 3
CBN_KILLFOCUS = 4
CBN_EDITCHANGE = 5
CBN_EDITUPDATE = 6
CBN_DROPDOWN = 7
CBN_CLOSEUP = 8
CBN_SELENDOK = 9
CBN_SELENDCANCEL = 10

CBS_SIMPLE = 1
CBS_DROPDOWN = 2
CBS_DROPDOWNLIST = 3
CBS_OWNERDRAWFIXED = $10
CBS_OWNERDRAWVARIABLE = $20
CBS_AUTOHSCROLL = $40
CBS_OEMCONVERT = $80
CBS_SORT = $100
CBS_HASSTRINGS = $200
CBS_NOINTEGRALHEIGHT = $400
CBS_DISABLENOSCROLL = $800
CBS_UPPERCASE = $2000
CBS_LOWERCASE = $4000

CB_GETEDITSEL = $140
CB_LIMITTEXT = $141
CB_SETEDITSEL = $142
CB_ADDSTRING = $143
CB_DELETESTRING = $144
CB_DIR = $145
CB_GETCOUNT = $146
CB_GETCURSEL = $147
CB_GETLBTEXT = $148
CB_GETLBTEXTLEN = $149
CB_INSERTSTRING = $14A
CB_RESETCONTENT = $14B
CB_FINDSTRING = $14C
CB_SELECTSTRING = $14D
CB_SETCURSEL = $14E
CB_SHOWDROPDOWN = $14F
CB_GETITEMDATA = $150
CB_SETITEMDATA = $151
CB_GETDROPPEDCONTROLRECT = $152
CB_SETITEMHEIGHT = $153
CB_GETITEMHEIGHT = $154
CB_SETEXTENDEDUI = $155
CB_GETEXTENDEDUI = $156
CB_GETDROPPEDSTATE = $157
CB_FINDSTRINGEXACT = $158
CB_SETLOCALE = $159
CB_GETLOCALE = $15A
CB_GETTOPINDEX = $15b
CB_SETTOPINDEX = $15c
CB_GETHORIZONTALEXTENT = $15d
CB_SETHORIZONTALEXTENT = $15e
CB_GETDROPPEDWIDTH = $15f
CB_SETDROPPEDWIDTH = $160
CB_INITSTORAGE = $161
CB_MULTIPLEADDSTRING = $163
CB_GETCOMBOBOXINFO = $164
CB_MSGMAX = $165

SBS_HORZ = 0
SBS_VERT = 1
SBS_TOPALIGN = 2
SBS_LEFTALIGN = 2
SBS_BOTTOMALIGN = 4
SBS_RIGHTALIGN	= 4
SBS_SIZEBOXTOPLEFTALIGN = 2
SBS_SIZEBOXBOTTOMRIGHTALIGN = 4
SBS_SIZEBOX = 8
SBS_SIZEGRIP = $10

SBM_SETPOS = $E0
SBM_GETPOS = $E1
SBM_SETRANGE = $E2
SBM_SETRANGEREDRAW = $E6
SBM_GETRANGE = $E3
SBM_ENABLE_ARROWS = $E4
SBM_SETSCROLLINFO = $E9
SBM_GETSCROLLINFO = $EA
SBM_GETSCROLLBARINFO = $EB

SIF_RANGE = 1
SIF_PAGE = 2
SIF_POS = 4
SIF_DISABLENOSCROLL = 8
SIF_TRACKPOS = $10
SIF_ALL = (SIF_RANGE or SIF_PAGE or SIF_POS or SIF_TRACKPOS)

struct SCROLLINFO
       cbSize dd ?
       fMask dd ?
       nMin dd ?
       nMax dd ?
       nPage dd ?
       nPos dd ?
       nTrackPos dd ?
ends

MDIS_ALLCHILDSTYLES = 1

MDITILE_VERTICAL = 0
MDITILE_HORIZONTAL = 1
MDITILE_SKIPDISABLED = 2
MDITILE_ZORDER = 4

struct MDICREATESTRUCTA
       szClass dq ?
       szTitle dq ?
       hOwner dq ?
       x dd ?
       y dd ?
       cx dd ?
       cy dd ?
       style dd ?,?
       lParam dq ?
ends

struct MDICREATESTRUCTW
       szClass dq ?
       szTitle dq ?
       hOwner dq ?
       x dd ?
       y dd ?
       cx dd ?
       cy dd ?
       style dd ?,?
       lParam dq ?
ends

struct CLIENTCREATESTRUCT
       hWindowMenu dq ?
       idFirstChild dd ?,?
ends

struct MULTIKEYHELPA
       mkSize dd ?
       mkKeylist db ?
       szKeyphrase db ?,?,?
ends

struct MULTIKEYHELPW
       mkSize dd ?
       mkKeylist dw ?
       szKeyphrase dw ?
ends

struct HELPWININFOA
       wStructSize dd ?
       x dd ?
       y dd ?
       dx dd ?
       dy dd ?
       wMax dd ?
       rgchMember db ?,?,?,?
ends

struct HELPWININFOW
       wStructSize dd ?
       x dd ?
       y dd ?
       dx dd ?
       dy dd ?
       wMax dd ?
       rgchMember dw ?,?
ends

HELP_CONTEXT = 1
HELP_QUIT = 2
HELP_INDEX = 3
HELP_CONTENTS = 3
HELP_HELPONHELP = 4
HELP_SETINDEX = 5
HELP_SETCONTENTS = 5
HELP_CONTEXTPOPUP = 8
HELP_FORCEFILE = 9
HELP_KEY = $101
HELP_COMMAND = $102
HELP_PARTIALKEY = $105
HELP_MULTIKEY = $201
HELP_SETWINPOS = $203
HELP_CONTEXTMENU  = $a
HELP_FINDER = $b
HELP_WM_HELP = $c
HELP_SETPOPUP_POS = $d
HELP_TCARD = $8000
HELP_TCARD_DATA = $10
HELP_TCARD_OTHER_CALLER = $11
IDH_NO_HELP = 28440
IDH_MISSING_CONTEXT = 28441
IDH_GENERIC_HELP_BUTTON = 28442
IDH_OK = 28443
IDH_CANCEL = 28444
IDH_HELP = 28445

GR_GDIOBJECTS = 0
GR_USEROBJECTS = 1

SPI_GETBEEP = 1
SPI_SETBEEP = 2
SPI_GETMOUSE = 3
SPI_SETMOUSE = 4
SPI_GETBORDER = 5
SPI_SETBORDER = 6
SPI_GETKEYBOARDSPEED = $A
SPI_SETKEYBOARDSPEED = $B
SPI_LANGDRIVER = $C
SPI_ICONHORIZONTALSPACING = $D
SPI_GETSCREENSAVETIMEOUT = $E
SPI_SETSCREENSAVETIMEOUT = $F
SPI_GETSCREENSAVEACTIVE = $10
SPI_SETSCREENSAVEACTIVE = $11
SPI_GETGRIDGRANULARITY = $12
SPI_SETGRIDGRANULARITY = $13
SPI_SETDESKWALLPAPER = $14
SPI_SETDESKPATTERN = $15
SPI_GETKEYBOARDDELAY = $16
SPI_SETKEYBOARDDELAY = $17
SPI_ICONVERTICALSPACING = $18
SPI_GETICONTITLEWRAP = $19
SPI_SETICONTITLEWRAP = $1A
SPI_GETMENUDROPALIGNMENT = $1B
SPI_SETMENUDROPALIGNMENT = $1C
SPI_SETDOUBLECLKWIDTH = $1D
SPI_SETDOUBLECLKHEIGHT = $1E
SPI_GETICONTITLELOGFONT = $1F
SPI_SETDOUBLECLICKTIME = $20
SPI_SETMOUSEBUTTONSWAP = $21
SPI_SETICONTITLELOGFONT = $22
SPI_GETFASTTASKSWITCH = $23
SPI_SETFASTTASKSWITCH = $24
SPI_SETDRAGFULLWINDOWS = $25
SPI_GETDRAGFULLWINDOWS = $26
SPI_GETNONCLIENTMETRICS = $29
SPI_SETNONCLIENTMETRICS = $2A
SPI_GETMINIMIZEDMETRICS = $2B
SPI_SETMINIMIZEDMETRICS = $2C
SPI_GETICONMETRICS = $2D
SPI_SETICONMETRICS = $2E
SPI_SETWORKAREA = $2F
SPI_GETWORKAREA = $30
SPI_SETPENWINDOWS = $31
SPI_GETHIGHCONTRAST = $42
SPI_SETHIGHCONTRAST = $43
SPI_GETKEYBOARDPREF = $44
SPI_SETKEYBOARDPREF = $45
SPI_GETSCREENREADER = $46
SPI_SETSCREENREADER = $47
SPI_GETANIMATION = $48
SPI_SETANIMATION = $49
SPI_GETFONTSMOOTHING = $4A
SPI_SETFONTSMOOTHING = $4B
SPI_SETDRAGWIDTH = $4C
SPI_SETDRAGHEIGHT = $4D
SPI_SETHANDHELD = $4E
SPI_GETLOWPOWERTIMEOUT = $4F
SPI_GETPOWEROFFTIMEOUT = $50
SPI_SETLOWPOWERTIMEOUT = $51
SPI_SETPOWEROFFTIMEOUT = $52
SPI_GETLOWPOWERACTIVE = $53
SPI_GETPOWEROFFACTIVE = $54
SPI_SETLOWPOWERACTIVE = $55
SPI_SETPOWEROFFACTIVE = $56
SPI_SETCURSORS = $57
SPI_SETICONS = $58
SPI_GETDEFAULTINPUTLANG = $59
SPI_SETDEFAULTINPUTLANG = $5A
SPI_SETLANGTOGGLE = $5B
SPI_GETWINDOWSEXTENSION = $5C
SPI_SETMOUSETRAILS = $5D
SPI_GETMOUSETRAILS = $5E
SPI_SETSCREENSAVERRUNNING = $61
SPI_SCREENSAVERRUNNING = SPI_SETSCREENSAVERRUNNING
SPI_GETFILTERKEYS = $32
SPI_SETFILTERKEYS = $33
SPI_GETTOGGLEKEYS = $34
SPI_SETTOGGLEKEYS = $35
SPI_GETMOUSEKEYS = $36
SPI_SETMOUSEKEYS = $37
SPI_GETSHOWSOUNDS = $38
SPI_SETSHOWSOUNDS = $39
SPI_GETSTICKYKEYS = $3A
SPI_SETSTICKYKEYS = $3B
SPI_GETACCESSTIMEOUT = $3C
SPI_SETACCESSTIMEOUT = $3D
SPI_GETSERIALKEYS = $3E
SPI_SETSERIALKEYS = $3F
SPI_GETSOUNDSENTRY = $40
SPI_SETSOUNDSENTRY = $41
SPI_GETSNAPTODEFBUTTON = $5F
SPI_SETSNAPTODEFBUTTON = $60
SPI_GETMOUSEHOVERWIDTH = $62
SPI_SETMOUSEHOVERWIDTH = $63
SPI_GETMOUSEHOVERHEIGHT = $64
SPI_SETMOUSEHOVERHEIGHT = $65
SPI_GETMOUSEHOVERTIME = $66
SPI_SETMOUSEHOVERTIME = $67
SPI_GETWHEELSCROLLLINES = $68
SPI_SETWHEELSCROLLLINES = $69
SPI_GETMENUSHOWDELAY = $6A
SPI_SETMENUSHOWDELAY = $6B
SPI_GETSHOWIMEUI = $6E
SPI_SETSHOWIMEUI = $6F
SPI_GETMOUSESPEED = $70
SPI_SETMOUSESPEED = $71
SPI_GETSCREENSAVERRUNNING = $72
SPI_GETDESKWALLPAPER = $73
SPI_GETACTIVEWINDOWTRACKING = $1000
SPI_SETACTIVEWINDOWTRACKING = $1001
SPI_GETMENUANIMATION = $1002
SPI_SETMENUANIMATION = $1003
SPI_GETCOMBOBOXANIMATION = $1004
SPI_SETCOMBOBOXANIMATION = $1005
SPI_GETLISTBOXSMOOTHSCROLLING = $1006
SPI_SETLISTBOXSMOOTHSCROLLING = $1007
SPI_GETGRADIENTCAPTIONS = $1008
SPI_SETGRADIENTCAPTIONS = $1009
SPI_GETKEYBOARDCUES = $100A
SPI_SETKEYBOARDCUES = $100B
SPI_GETMENUUNDERLINES = SPI_GETKEYBOARDCUES
SPI_SETMENUUNDERLINES = SPI_SETKEYBOARDCUES
SPI_GETACTIVEWNDTRKZORDER = $100C
SPI_SETACTIVEWNDTRKZORDER = $100D
SPI_GETHOTTRACKING = $100E
SPI_SETHOTTRACKING = $100F
SPI_GETMENUFADE = $1012
SPI_SETMENUFADE = $1013
SPI_GETSELECTIONFADE = $1014
SPI_SETSELECTIONFADE = $1015
SPI_GETTOOLTIPANIMATION = $1016
SPI_SETTOOLTIPANIMATION = $1017
SPI_GETTOOLTIPFADE = $1018
SPI_SETTOOLTIPFADE = $1019
SPI_GETCURSORSHADOW = $101A
SPI_SETCURSORSHADOW = $101B
SPI_GETMOUSESONAR = $101C
SPI_SETMOUSESONAR = $101D
SPI_GETMOUSECLICKLOCK = $101E
SPI_SETMOUSECLICKLOCK = $101F
SPI_GETMOUSEVANISH = $1020
SPI_SETMOUSEVANISH = $1021
SPI_GETFLATMENU = $1022
SPI_SETFLATMENU = $1023
SPI_GETDROPSHADOW = $1024
SPI_SETDROPSHADOW = $1025
SPI_GETBLOCKSENDINPUTRESETS = $1026
SPI_SETBLOCKSENDINPUTRESETS = $1027
SPI_GETUIEFFECTS = $103E
SPI_SETUIEFFECTS = $103F
SPI_GETFOREGROUNDLOCKTIMEOUT = $2000
SPI_SETFOREGROUNDLOCKTIMEOUT = $2001
SPI_GETACTIVEWNDTRKTIMEOUT = $2002
SPI_SETACTIVEWNDTRKTIMEOUT = $2003
SPI_GETFOREGROUNDFLASHCOUNT = $2004
SPI_SETFOREGROUNDFLASHCOUNT = $2005
SPI_GETCARETWIDTH = $2006
SPI_SETCARETWIDTH = $2007
SPI_GETMOUSECLICKLOCKTIME = $2008
SPI_SETMOUSECLICKLOCKTIME = $2009
SPI_GETFONTSMOOTHINGTYPE = $200A
SPI_SETFONTSMOOTHINGTYPE = $200B
FE_FONTSMOOTHINGSTANDARD = 1
FE_FONTSMOOTHINGCLEARTYPE = 2
FE_FONTSMOOTHINGDOCKING = $8000
SPI_GETFONTSMOOTHINGCONTRAST = $200C
SPI_SETFONTSMOOTHINGCONTRAST = $200D
SPI_GETFOCUSBORDERWIDTH = $200E
SPI_SETFOCUSBORDERWIDTH = $200F
SPI_GETFOCUSBORDERHEIGHT = $2010
SPI_SETFOCUSBORDERHEIGHT = $2011
SPI_GETFONTSMOOTHINGORIENTATION = $2012
SPI_SETFONTSMOOTHINGORIENTATION = $2013

FE_FONTSMOOTHINGORIENTATIONBGR = 0
FE_FONTSMOOTHINGORIENTATIONRGB = 1

SPIF_UPDATEINIFILE = 1
SPIF_SENDWININICHANGE = 2
SPIF_SENDCHANGE = SPIF_SENDWININICHANGE
METRICS_USEDEFAULT = -1

struct NONCLIENTMETRICS
       cbSize dd ?
       iBorderWidth dd ?
       iScrollWidth dd ?
       iScrollHeight dd ?
       iCaptionWidth dd ?
       iCaptionHeight dd ?
       lfCaptionFont USERLOGFONT
       iSmCaptionWidth dd ?
       iSmCaptionHeight dd ?
       lfSmCaptionFont USERLOGFONT
       iMenuWidth dd ?
       iMenuHeight dd ?
       lfMenuFont USERLOGFONT
       lfStatusFont USERLOGFONT
       lfMessageFont USERLOGFONT
       iPaddedBorderWidth dd ?
ends

ARW_BOTTOMLEFT = 0
ARW_BOTTOMRIGHT = 1
ARW_TOPLEFT = 2
ARW_TOPRIGHT = 3
ARW_STARTMASK = 3
ARW_STARTRIGHT = 1
ARW_STARTTOP = 2
ARW_LEFT = 0
ARW_RIGHT = 0
ARW_UP = 4
ARW_DOWN = 4
ARW_HIDE = 8

struct MINIMIZEDMETRICS
       cbSize dd ?
       iWidth dd ?
       iHorzGap dd ?
       iVertGap dd ?
       iArrange dd ?
ends

struct ICONMETRICS
       cbSize dd ?
       iHorzSpacing dd ?
       iVertSpacing dd ?
       iTitleWrap dd ?
       lfFont USERLOGFONT
ends

struct ANIMATIONINFO
       cbSize dd ?
       iMinAnimate dd ?
ends

struct SERIALKEYSA
       cbSize dd ?
       dwFlags dd ?
       lpszActivePort dq ?
       lpszPort dq ?
       iBaudRate dd ?
       iPortState dd ?
       iActive dd ?,?
ends

struct SERIALKEYSW
       cbSize dd ?
       dwFlags dd ?
       lpszActivePort dq ?
       lpszPort dq ?
       iBaudRate dd ?
       iPortState dd ?
       iActive dd ?,?
ends

SERKF_SERIALKEYSON = 1
SERKF_AVAILABLE = 2
SERKF_INDICATOR = 4

struct HIGHCONTRASTA
       cbSize dd ?
       dwFlags dd ?
       lpszDefaultScheme dq ?
ends

struct HIGHCONTRASTW
       cbSize dd ?
       dwFlags dd ?
       lpszDefaultScheme dq ?
ends

HCF_HIGHCONTRASTON = 1
HCF_AVAILABLE = 2
HCF_HOTKEYACTIVE = 4
HCF_CONFIRMHOTKEY = 8
HCF_HOTKEYSOUND = $10
HCF_INDICATOR = $20
HCF_HOTKEYAVAILABLE = $40
HCF_LOGONDESKTOP = $100
HCF_DEFAULTDESKTOP = $200

CDS_UPDATEREGISTRY = 1
CDS_TEST = 2
CDS_FULLSCREEN = 4
CDS_GLOBAL = 8
CDS_SET_PRIMARY = $10
CDS_VIDEOPARAMETERS = $20
CDS_RESET = $40000000
CDS_NORESET = $10000000

DISP_CHANGE_SUCCESSFUL = 0
DISP_CHANGE_RESTART = 1
DISP_CHANGE_FAILED = -1
DISP_CHANGE_BADMODE = -2
DISP_CHANGE_NOTUPDATED = -3
DISP_CHANGE_BADFLAGS = -4
DISP_CHANGE_BADPARAM = -5
DISP_CHANGE_BADDUALVIEW = -6

ENUM_CURRENT_SETTINGS = -1
ENUM_REGISTRY_SETTINGS = -2

EDS_RAWMODE = 2

struct FILTERKEYS
       cbSize dd ?
       dwFlags dd ?
       iWaitMSec dd ?
       iDelayMSec dd ?
       iRepeatMSec dd ?
       iBounceMSec dd ?
ends

FKF_FILTERKEYSON = 1
FKF_AVAILABLE = 2
FKF_HOTKEYACTIVE = 4
FKF_CONFIRMHOTKEY = 8
FKF_HOTKEYSOUND = $10
FKF_INDICATOR = $20
FKF_CLICKON = $40

struct STICKYKEYS
       cbSize dd ?
       dwFlags dd ?
ends

SKF_STICKYKEYSON = 1
SKF_AVAILABLE = 2
SKF_HOTKEYACTIVE = 4
SKF_CONFIRMHOTKEY = 8
SKF_HOTKEYSOUND = $10
SKF_INDICATOR = $20
SKF_AUDIBLEFEEDBACK = $40
SKF_TRISTATE = $80
SKF_TWOKEYSOFF = $100
SKF_LALTLATCHED = $10000000
SKF_LCTLLATCHED = $4000000
SKF_LSHIFTLATCHED = $1000000
SKF_RALTLATCHED = $20000000
SKF_RCTLLATCHED = $8000000
SKF_RSHIFTLATCHED = $2000000
SKF_LWINLATCHED = $40000000
SKF_RWINLATCHED = $80000000
SKF_LALTLOCKED = $100000
SKF_LCTLLOCKED = $40000
SKF_LSHIFTLOCKED = $10000
SKF_RALTLOCKED = $200000
SKF_RCTLLOCKED = $80000
SKF_RSHIFTLOCKED = $20000
SKF_LWINLOCKED = $400000
SKF_RWINLOCKED = $800000

struct MOUSEKEYS
       cbSize dd ?
       dwFlags dd ?
       iMaxSpeed dd ?
       iTimeToMaxSpeed dd ?
       iCtrlSpeed dd ?
       dwReserved1 dd ?
       dwReserved2 dd ?
ends

MKF_MOUSEKEYSON = 1
MKF_AVAILABLE = 2
MKF_HOTKEYACTIVE = 4
MKF_CONFIRMHOTKEY = 8
MKF_HOTKEYSOUND = $10
MKF_INDICATOR = $20
MKF_MODIFIERS = $40
MKF_REPLACENUMBERS = $80
MKF_LEFTBUTTONSEL = $10000000
MKF_RIGHTBUTTONSEL = $20000000
MKF_LEFTBUTTONDOWN = $1000000
MKF_RIGHTBUTTONDOWN = $2000000
MKF_MOUSEMODE = $80000000

struct ACCESSTIMEOUT
       cbSize dd ?
       dwFlags dd ?
       iTimeOutMSec dd ?
ends

ATF_TIMEOUTON = 1
ATF_ONOFFFEEDBACK = 2

SSGF_NONE = 0
SSGF_DISPLAY = 3

SSTF_NONE = 0
SSTF_CHARS = 1
SSTF_BORDER = 2
SSTF_DISPLAY = 3

SSWF_NONE = 0
SSWF_TITLE = 1
SSWF_WINDOW = 2
SSWF_DISPLAY = 3
SSWF_CUSTOM = 4

struct SOUNDSENTRYA
       cbSize dd ?
       dwFlags dd ?
       iFSTextEffect dd ?
       iFSTextEffectMSec dd ?
       iFSTextEffectColorBits dd ?
       iFSGrafEffect dd ?
       iFSGrafEffectMSec dd ?
       iFSGrafEffectColor dd ?
       iWindowsEffect dd ?
       iWindowsEffectMSec dd ?
       lpszWindowsEffectDLL dq ?
       iWindowsEffectOrdinal dd ?,?
ends

struct SOUNDSENTRYW
       cbSize dd ?
       dwFlags dd ?
       iFSTextEffect dd ?
       iFSTextEffectMSec dd ?
       iFSTextEffectColorBits dd ?
       iFSGrafEffect dd ?
       iFSGrafEffectMSec dd ?
       iFSGrafEffectColor dd ?
       iWindowsEffect dd ?
       iWindowsEffectMSec dd ?
       lpszWindowsEffectDLL dq ?
       iWindowsEffectOrdinal dd ?,?
ends

SSF_SOUNDSENTRYON = 1
SSF_AVAILABLE = 2
SSF_INDICATOR = 4

struct TOGGLEKEYS
       cbSize dd ?
       dwFlags dd ?
ends

TKF_TOGGLEKEYSON = 1
TKF_AVAILABLE = 2
TKF_HOTKEYACTIVE = 4
TKF_CONFIRMHOTKEY = 8
TKF_HOTKEYSOUND = 10
TKF_INDICATOR = 20

SLE_ERROR = 1
SLE_MINORERROR = 2
SLE_WARNING = 3

MONITOR_DEFAULTTONULL = 0
MONITOR_DEFAULTTOPRIMARY = 1
MONITOR_DEFAULTTONEAREST = 2
MONITORINFOF_PRIMARY = 1

CCHDEVICENAME = 32

struct AUDIODESCRIPTION
       cbSize dd ?
       Enabled dd ?
       Locale dd ?
ends

struct MONITORINFO
       cbSize dd ?
       rcMonitor RECT
       rcWork RECT
       dwFlags dd ?
ends

struct MONITORINFOEXA
       monitorinfo MONITORINFO
       szDevice db CCHDEVICENAME dup(?)
ends

struct MONITORINFOEXW
       monitorinfo MONITORINFO
       szDevice du CCHDEVICENAME dup(?)
ends

WINEVENT_OUTOFCONTEXT = 0
WINEVENT_SKIPOWNTHREAD = 1
WINEVENT_SKIPOWNPROCESS = 2
WINEVENT_INCONTEXT = 4

CHILDID_SELF = 0
INDEXID_OBJECT = 0
INDEXID_CONTAINER = 0

OBJID_WINDOW =	0
OBJID_SYSMENU = $FFFFFFFF
OBJID_TITLEBAR = $FFFFFFFE
OBJID_MENU = $FFFFFFFD
OBJID_CLIENT = $FFFFFFFC
OBJID_VSCROLL = $FFFFFFFB
OBJID_HSCROLL = $FFFFFFFA
OBJID_SIZEGRIP = $FFFFFFF9
OBJID_CARET = $FFFFFFF8
OBJID_CURSOR = $FFFFFFF7
OBJID_ALERT = $FFFFFFF6
OBJID_SOUND = $FFFFFFF5
OBJID_QUERYCLASSNAMEIDX = $FFFFFFF4
OBJID_NATIVEOM = $FFFFFFF0

EVENT_MIN = 1
EVENT_MAX = $7FFFFFFF
EVENT_SYSTEM_SOUND = 1
EVENT_SYSTEM_ALERT = 2
EVENT_SYSTEM_FOREGROUND = 3
EVENT_SYSTEM_MENUSTART = 4
EVENT_SYSTEM_MENUEND = 5
EVENT_SYSTEM_MENUPOPUPSTART = 6
EVENT_SYSTEM_MENUPOPUPEND = 7
EVENT_SYSTEM_CAPTURESTART = 8
EVENT_SYSTEM_CAPTUREEND = 9
EVENT_SYSTEM_MOVESIZESTART = $A
EVENT_SYSTEM_MOVESIZEEND = $B
EVENT_SYSTEM_CONTEXTHELPSTART = $C
EVENT_SYSTEM_CONTEXTHELPEND = $D
EVENT_SYSTEM_DRAGDROPSTART = $E
EVENT_SYSTEM_DRAGDROPEND = $F
EVENT_SYSTEM_DIALOGSTART = $10
EVENT_SYSTEM_DIALOGEND = $11
EVENT_SYSTEM_SCROLLINGSTART = $12
EVENT_SYSTEM_SCROLLINGEND = $13
EVENT_SYSTEM_SWITCHSTART = $14
EVENT_SYSTEM_SWITCHEND = $15
EVENT_SYSTEM_MINIMIZESTART = $16
EVENT_SYSTEM_MINIMIZEEND = $17
EVENT_CONSOLE_CARET = $4001
EVENT_CONSOLE_UPDATE_REGION = $4002
EVENT_CONSOLE_UPDATE_SIMPLE = $4003
EVENT_CONSOLE_UPDATE_SCROLL = $4004
EVENT_CONSOLE_LAYOUT = $4005
EVENT_CONSOLE_START_APPLICATION = $4006
EVENT_CONSOLE_END_APPLICATION = $4007

CONSOLE_APPLICATION_16BIT = 1
CONSOLE_CARET_SELECTION = 1
CONSOLE_CARET_VISIBLE = 2

EVENT_OBJECT_CREATE = $8000
EVENT_OBJECT_DESTROY = $8001
EVENT_OBJECT_SHOW = $8002
EVENT_OBJECT_HIDE = $8003
EVENT_OBJECT_REORDER = $8004
EVENT_OBJECT_FOCUS = $8005
EVENT_OBJECT_SELECTION = $8006
EVENT_OBJECT_SELECTIONADD = $8007
EVENT_OBJECT_SELECTIONREMOVE = $8008
EVENT_OBJECT_SELECTIONWITHIN = $8009
EVENT_OBJECT_STATECHANGE = $800A
EVENT_OBJECT_LOCATIONCHANGE = $800B
EVENT_OBJECT_NAMECHANGE = $800C
EVENT_OBJECT_DESCRIPTIONCHANGE = $800D
EVENT_OBJECT_VALUECHANGE = $800E
EVENT_OBJECT_PARENTCHANGE = $800F
EVENT_OBJECT_HELPCHANGE = $8010
EVENT_OBJECT_DEFACTIONCHANGE = $8011
EVENT_OBJECT_ACCELERATORCHANGE = $8012

SOUND_SYSTEM_STARTUP = 1
SOUND_SYSTEM_SHUTDOWN = 2
SOUND_SYSTEM_BEEP = 3
SOUND_SYSTEM_ERROR = 4
SOUND_SYSTEM_QUESTION = 5
SOUND_SYSTEM_WARNING = 6
SOUND_SYSTEM_INFORMATION = 7
SOUND_SYSTEM_MAXIMIZE = 8
SOUND_SYSTEM_MINIMIZE = 9
SOUND_SYSTEM_RESTOREUP = 10
SOUND_SYSTEM_RESTOREDOWN = 11
SOUND_SYSTEM_APPSTART = 12
SOUND_SYSTEM_FAULT = 13
SOUND_SYSTEM_APPEND = 14
SOUND_SYSTEM_MENUCOMMAND = 15
SOUND_SYSTEM_MENUPOPUP = 16
CSOUND_SYSTEM = 16

ALERT_SYSTEM_INFORMATIONAL = 1
ALERT_SYSTEM_WARNING = 2
ALERT_SYSTEM_ERROR = 3
ALERT_SYSTEM_QUERY = 4
ALERT_SYSTEM_CRITICAL = 5
CALERT_SYSTEM = 6

struct GUITHREADINFO
       cbSize dd ?
       flags dd ?
       hwndActive dq ?
       hwndFocus dq ?
       hwndCapture dq ?
       hwndMenuOwner dq ?
       hwndMoveSize dq ?
       hwndCaret dq ?
       rcCaret RECT
ends

GUI_CARETBLINKING = 1
GUI_INMOVESIZE = 2
GUI_INMENUMODE = 4
GUI_SYSTEMMENUMODE = 8
GUI_POPUPMENUMODE = $10
GUI_16BITTASK = $20

STATE_SYSTEM_UNAVAILABLE = 1
STATE_SYSTEM_SELECTED = 2
STATE_SYSTEM_FOCUSED = 4
STATE_SYSTEM_PRESSED = 8
STATE_SYSTEM_CHECKED = $10
STATE_SYSTEM_MIXED = $20
STATE_SYSTEM_INDETERMINATE = STATE_SYSTEM_MIXED
STATE_SYSTEM_READONLY = $40
STATE_SYSTEM_HOTTRACKED = $80
STATE_SYSTEM_DEFAULT = $100
STATE_SYSTEM_EXPANDED = $200
STATE_SYSTEM_COLLAPSED = $400
STATE_SYSTEM_BUSY = $800
STATE_SYSTEM_FLOATING = $1000
STATE_SYSTEM_MARQUEED = $2000
STATE_SYSTEM_ANIMATED = $4000
STATE_SYSTEM_INVISIBLE = $8000
STATE_SYSTEM_OFFSCREEN = $10000
STATE_SYSTEM_SIZEABLE = $20000
STATE_SYSTEM_MOVEABLE = $40000
STATE_SYSTEM_SELFVOICING = $80000
STATE_SYSTEM_FOCUSABLE = $100000
STATE_SYSTEM_SELECTABLE = $200000
STATE_SYSTEM_LINKED = $400000
STATE_SYSTEM_TRAVERSED = $800000
STATE_SYSTEM_MULTISELECTABLE = $1000000
STATE_SYSTEM_EXTSELECTABLE = $2000000
STATE_SYSTEM_ALERT_LOW = $4000000
STATE_SYSTEM_ALERT_MEDIUM = $8000000
STATE_SYSTEM_ALERT_HIGH = $10000000
STATE_SYSTEM_PROTECTED = $20000000
STATE_SYSTEM_VALID = $3FFFFFFF

CCHILDREN_TITLEBAR = 5
CCHILDREN_SCROLLBAR = 5

struct CURSORINFO
       cbSize dd ?
       flags dd ?
       hCursor dq ?
       ptScreenPos POINT
ends

CURSOR_SHOWING = 1

struct WINDOWINFO
       cbSize dd ?
       rcWindow RECT
       rcClient RECT
       dwStyle dd ?
       dwExStyle dd ?
       dwWindowStatus dd ?
       cxWindowBorders dd ?
       cyWindowBorders dd ?
       atomWindowType dw ?
       wCreatorVersion dw ?
ends

WS_ACTIVECAPTION = 1

struct TITLEBARINFO
       cbSize dd ?
       rcTitleBar RECT
       rgstate dd (CCHILDREN_TITLEBAR + 1) dup(?)
ends

struct MENUBARINFO
       cbSize dd ?
       rcBar RECT
       pad1 dd ?
       hMenu dq ?
       hwndMenu dq ?
       union
	   fBarFocused dd ?
	   fFocused dd ?
       ends
       pad2 dd ?
ends

struct SCROLLBARINFO
       cbSize dd ?
       rcScrollBar RECT
       dxyLineButton dd ?
       xyThumbTop dd ?
       xyThumbBottom dd ?
       reserved dd ?
       rgstate dd (CCHILDREN_SCROLLBAR + 1) dup(?)
ends

struct COMBOBOXINFO
       cbSize dd ?
       rcItem RECT
       rcButton RECT
       stateButton dd ?
       hwndCombo dq ?
       hwndItem dq ?
       hwndList dq ?
ends

GA_PARENT = 1
GA_ROOT = 2
GA_ROOTOWNER = 3

struct ALTTABINFO
       cbSize dd ?
       cItems dd ?
       cColumns dd ?
       cRows dd ?
       iColFocus dd ?
       iRowFocus dd ?
       cxItem dd ?
       cyItem dd ?
       ptStart POINT
ends

RIM_INPUT = 0
RIM_INPUTSINK = 1

struct RAWINPUTHEADER
       dwType dd ?
       dwSize dd ?
       hDevice dq ?
       wParam dq ?
ends

RIM_TYPEMOUSE = 0
RIM_TYPEKEYBOARD = 1
RIM_TYPEHID = 2

struct RAWMOUSE
       usFlags dw ?
       union
	   ulButtons dd ?
	   struct
	       usButtonFlags dw ?
	       usButtonData dw ?
	   ends
       ends
       ulRawButtons dd ?
       lLastX dd ?
       lLastY dd ?
       ulExtraInformation dd ?
       pad1 dw ?
ends

RI_MOUSE_LEFT_BUTTON_DOWN = 1
RI_MOUSE_LEFT_BUTTON_UP = 2
RI_MOUSE_RIGHT_BUTTON_DOWN = 4
RI_MOUSE_RIGHT_BUTTON_UP = 8
RI_MOUSE_MIDDLE_BUTTON_DOWN = $10
RI_MOUSE_MIDDLE_BUTTON_UP = $20
RI_MOUSE_BUTTON_1_DOWN = RI_MOUSE_LEFT_BUTTON_DOWN
RI_MOUSE_BUTTON_1_UP = RI_MOUSE_LEFT_BUTTON_UP
RI_MOUSE_BUTTON_2_DOWN = RI_MOUSE_RIGHT_BUTTON_DOWN
RI_MOUSE_BUTTON_2_UP = RI_MOUSE_RIGHT_BUTTON_UP
RI_MOUSE_BUTTON_3_DOWN = RI_MOUSE_MIDDLE_BUTTON_DOWN
RI_MOUSE_BUTTON_3_UP = RI_MOUSE_MIDDLE_BUTTON_UP
RI_MOUSE_BUTTON_4_DOWN = $40
RI_MOUSE_BUTTON_4_UP = $80
RI_MOUSE_BUTTON_5_DOWN = $100
RI_MOUSE_BUTTON_5_UP = $200
RI_MOUSE_WHEEL = $400

MOUSE_MOVE_RELATIVE = 0
MOUSE_MOVE_ABSOLUTE = 1
MOUSE_VIRTUAL_DESKTOP = 2
MOUSE_ATTRIBUTES_CHANGED = 4

struct RAWKEYBOARD
       MakeCode dw ?
       Flags dw ?
       Reserved dw ?
       VKey dw ?
       Message dd ?
       ExtraInformation dd ?
ends

KEYBOARD_OVERRUN_MAKE_CODE = $FF

RI_KEY_MAKE = 0
RI_KEY_BREAK = 1
RI_KEY_E0 = 2
RI_KEY_E1 = 4
RI_KEY_TERMSRV_SET_LED = 8
RI_KEY_TERMSRV_SHADOW = $10

struct RAWHID
       dwSizeHid dd ?
       dwCount dd ?
       bRawData db ?,?,?,?
ends

struct RAWINPUT
       header RAWINPUTHEADER
       union
	   mouse RAWMOUSE
	   keyboard RAWKEYBOARD
	   hid RAWHID
       ends
ends

RID_INPUT = $10000003
RID_HEADER = $10000005

RIDI_PREPARSEDDATA = $20000005
RIDI_DEVICENAME = $20000007
RIDI_DEVICEINFO = $2000000b

struct RIDDEVICEINFOMOUSE
       dwId dd ?
       dwNumberOfButtons dd ?
       dwSampleRate dd ?
ends

struct RIDDEVICEINFOKEYBOARD
       dwType dd ?
       dwSubType dd ?
       dwKeyboardMode dd ?
       dwNumberOfFunctionKeys dd ?
       dwNumberOfIndicators dd ?
       dwNumberOfKeysTotal dd ?
ends

struct RIDDEVICEINFOHID
       dwVendorId dd ?
       dwProductId dd ?
       dwVersionNumber dd ?
       usUsagePage dw ?
       usUsage dw ?
ends

struct RIDDEVICEINFO
       cbSize dd ?
       dwType dd ?
       union
	   mouse RIDDEVICEINFOMOUSE
	   keyboard RIDDEVICEINFOKEYBOARD
	   hid RIDDEVICEINFOHID
       ends
ends

RIDEV_REMOVE = 1
RIDEV_EXCLUDE = $10
RIDEV_PAGEONLY = $20
RIDEV_NOLEGACY = $30
RIDEV_INPUTSINK = $100
RIDEV_CAPTUREMOUSE = $200
RIDEV_NOHOTKEYS = $200
RIDEV_APPKEYS = $400
RIDEV_EXMODEMASK = $F0

struct RAWINPUTDEVICELIST
       hDevice dq ?
       dwType dd ?,?
ends

CP_ACP = 0
CP_OEMCP = 1
CP_MACCP = 2
CP_THREAD_ACP = 3
CP_SYMBOL = 42
CP_UTF7 = 65000
CP_UTF8 = 65001

struct WNDCLASSEX
  cbSize	dd ?
  style 	dd ?
  lpfnWndProc	dq ?
  cbClsExtra	dd ?
  cbWndExtra	dd ?
  hInstance	dq ?
  hIcon 	dq ?
  hCursor	dq ?
  hbrBackground dq ?
  lpszMenuName	dq ?
  lpszClassName dq ?
  hIconSm	dq ?
ends